/* Doctors Lab Mileage Tracker - Main Stylesheet */

:root {
    --primary-red: #DC143C;
    --primary-blue: #0066CC;
    --primary-black: #000000;
    --primary-white: #FFFFFF;
    --light-gray: #F5F5F5;
    --medium-gray: #CCCCCC;
    --dark-gray: #666666;
    --success-green: #28A745;
    --error-red: #DC3545;
    --warning-yellow: #FFC107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-gray);
    color: var(--primary-black);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.main-header {
    background: var(--primary-black);
    color: var(--primary-white);
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
}

.logo-text {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
}

.logo-doctors {
    background-color: var(--primary-red);
    color: var(--primary-white);
    padding: 0.5rem 1rem;
}

.logo-lab {
    background-color: var(--primary-black);
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
}

.logo-lab sup {
    font-size: 0.6em;
    color: var(--primary-white);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
    justify-content: flex-end;
}

.app-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-white);
    margin-right: auto;
}

.user-info {
    font-size: 0.9rem;
}

.btn-logout {
    background-color: rgba(255,255,255,0.2);
    color: var(--primary-white);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background-color: rgba(255,255,255,0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Footer */
.main-footer {
    background-color: var(--primary-black);
    color: var(--primary-white);
    text-align: center;
    padding: 1rem 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Card Styles */
.card {
    background: var(--primary-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.card-header {
    border-bottom: 2px solid var(--primary-red);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    color: var(--primary-red);
    font-weight: bold;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-gray);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.form-control:disabled {
    background-color: var(--light-gray);
    cursor: not-allowed;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--primary-white);
}

.btn-primary:hover {
    background-color: #0052A3;
}

.btn-secondary {
    background-color: var(--dark-gray);
    color: var(--primary-white);
}

.btn-secondary:hover {
    background-color: #555;
}

.btn-danger {
    background-color: var(--error-red);
    color: var(--primary-white);
}

.btn-danger:hover {
    background-color: #C82333;
}

.btn-success {
    background-color: var(--success-green);
    color: var(--primary-white);
}

.btn-success:hover {
    background-color: #218838;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Menu Styles */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.menu-item {
    background: var(--primary-white);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: var(--primary-black);
    display: block;
}

.menu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.menu-item-icon {
    font-size: 3rem;
    color: var(--primary-red);
    margin-bottom: 1rem;
}

.menu-item-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-black);
    margin-bottom: 0.5rem;
}

.menu-item-desc {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--primary-white);
}

table th,
table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

table th {
    background-color: var(--primary-red);
    color: var(--primary-white);
    font-weight: 600;
}

table tr:hover {
    background-color: var(--light-gray);
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.alert-error {
    background-color: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

.alert-info {
    background-color: #D1ECF1;
    color: #0C5460;
    border: 1px solid #BEE5EB;
}

/* Back Button */
.back-button-container {
    margin-bottom: 1rem;
}

.btn-back {
    background: var(--primary-white);
    color: var(--primary-black);
    border: 1px solid var(--medium-gray);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-back:hover {
    background: var(--light-gray);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* Mileage Entry Styles */
.mileage-stops {
    margin-top: 1.5rem;
}

.stop-item {
    background: var(--light-gray);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-blue);
    position: relative;
}

.stop-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.stop-number {
    background-color: var(--primary-red);
    color: var(--primary-white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
}

.stop-controls {
    display: flex;
    gap: 0.5rem;
}

.stop-controls button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-gray);
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
}

.stop-controls button:hover {
    color: var(--primary-red);
}

.stop-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.mileage-total {
    background: var(--primary-blue);
    color: var(--primary-white);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    margin-top: 1rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.mileage-total-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.mileage-total-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 0.25rem;
}

/* Sortable Styles */
.sortable-ghost {
    opacity: 0.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .app-title {
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    .header-nav {
        width: 100%;
        justify-content: center;
    }
    
    .main-content {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .stop-form-row {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        font-size: 0.875rem;
    }
    
    table th,
    table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.2rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--light-gray);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none;
}

