/* Modern Professional UI Styles */

:root {
    --primary-color: #4A90E2;
    --secondary-color: #50C878;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --info-color: #3498DB;
    --dark-color: #2C3E50;
    --light-gray: #F8F9FA;
    --border-color: #E1E8ED;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C8D;
}

body {
    background: #F5F7FA;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: var(--text-primary);
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.login-box {
    background: white;
    padding: 40px 35px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border-color);
}

.login-box h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 24px;
    font-weight: 600;
}

.login-box h2 {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 15px;
    font-weight: 400;
}

/* Dashboard Styles */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
}

.header {
    background: white;
    padding: 16px 24px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border-color);
}

.header h1 {
    color: var(--dark-color);
    margin-bottom: 0;
    font-size: 22px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Cards */
.card {
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    background: white;
    padding: 20px;
}

.card-body {
    padding: 20px;
}

.card h2 {
    color: var(--dark-color);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--light-gray);
    color: var(--dark-color);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    padding: 14px 12px;
}

.table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    font-size: 14px;
    color: var(--text-primary);
}

.table-hover tbody tr:hover {
    background-color: #F8FBFF;
}

/* Buttons - Override Bootstrap with cleaner styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    background: #3A7BC8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

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

.btn-success:hover {
    background: #45B369;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(80, 200, 120, 0.3);
}

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

.btn-danger:hover {
    background: #C44133;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

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

.btn-info:hover {
    background: #2E86C1;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.btn-warning:hover {
    background: #E68A00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-secondary {
    background: #95A5A6;
    color: white;
}

.btn-secondary:hover {
    background: #7F8C8D;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 10px 24px;
    font-size: 15px;
}

/* Form Elements */
.form-control {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 6px;
    font-size: 13px;
}

.form-group {
    margin-bottom: 16px;
}

/* Statistics Cards */
.stat-card {
    background: white;
    padding: 18px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.stat-card h3 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card p {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--dark-color);
}

.stat-card.primary {
    border-left: 4px solid var(--primary-color);
}

.stat-card.success {
    border-left: 4px solid var(--secondary-color);
}

.stat-card.warning {
    border-left: 4px solid var(--warning-color);
}

.stat-card.danger {
    border-left: 4px solid var(--danger-color);
}

.stat-card.info {
    border-left: 4px solid var(--info-color);
}

/* Alert Messages */
.alert {
    border-radius: 10px;
    border: none;
    padding: 14px 20px;
    font-size: 14px;
    margin-bottom: 20px;
}

.alert-success {
    background: #D4EDDA;
    color: #155724;
    border-left: 4px solid var(--secondary-color);
}

.alert-danger {
    background: #F8D7DA;
    color: #721C24;
    border-left: 4px solid var(--danger-color);
}

.alert-info {
    background: #D1ECF1;
    color: #0C5460;
    border-left: 4px solid var(--info-color);
}

.alert-warning {
    background: #FFF3CD;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

/* Custom patient search/selection styles */
.patient-mode-selector {
    display: flex;
    gap: 15px;
    margin-bottom: 16px;
    padding: 14px;
    background: var(--light-gray);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.patient-mode-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-color);
    padding: 8px 16px;
    background: white;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    transition: all 0.2s;
}

.patient-mode-selector label:hover {
    border-color: var(--primary-color);
    background: #F8FBFF;
}

.patient-mode-selector input[type="radio"]:checked + span {
    color: var(--primary-color);
}

.search-section {
    margin-bottom: 16px;
    padding: 14px;
    background: var(--light-gray);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.search-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 12px;
}

.search-results {
    margin-top: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    max-height: 350px;
    overflow-y: auto;
}

.patient-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.patient-result-item:hover {
    background: #F8FBFF;
}

.patient-result-item:last-child {
    border-bottom: none;
}

.patient-info {
    flex: 1;
}

.patient-info strong {
    color: var(--dark-color);
    font-size: 14px;
    font-weight: 600;
}

.patient-info small {
    color: var(--text-secondary);
    font-size: 12px;
}

.visit-badge {
    background: var(--info-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.readonly-field {
    background-color: var(--light-gray) !important;
    cursor: not-allowed;
}

.age-display {
    margin-top: 8px;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
}

/* Status badges */
.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
}

.status-registered {
    background: #FFF3CD;
    color: #856404;
}

.status-reception_done {
    background: #D1ECF1;
    color: #0C5460;
}

.status-bp_done {
    background: #E2D9F3;
    color: #6610F2;
}

.status-doctor_seen {
    background: #FFE5D0;
    color: #D9480F;
}

.status-doctor_done {
    background: #D4EDDA;
    color: #155724;
}

.status-payment_done {
    background: #CCE5FF;
    color: #004085;
}

.status-mixing_done {
    background: #E7D9FF;
    color: #5E17EB;
}

.status-treatment_done {
    background: #FFD6E7;
    color: #D63384;
}

.status-completed {
    background: #D4EDDA;
    color: #155724;
    border: 2px solid #28A745;
}

/* Page-specific improvements */
.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 0;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* Custom Tab Styling */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
}

.nav-tabs .nav-item {
    margin-bottom: -2px;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    padding: 12px 24px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
    background: var(--light-gray);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
    font-weight: 600;
}

.tab-content {
    padding-top: 20px;
}
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    margin-right: 5px;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-registered {
    background: #ffc107;
    color: #000;
}

.status-reception_done {
    background: #17a2b8;
    color: white;
}

.status-bp_done {
    background: #007bff;
    color: white;
}

.status-doctor_seen {
    background: #6f42c1;
    color: white;
}

.status-payment_done {
    background: #28a745;
    color: white;
}

.status-mixing_done {
    background: #20c997;
    color: white;
}

.status-treatment_done {
    background: #fd7e14;
    color: white;
}

.status-completed {
    background: #28a745;
    color: white;
}

.status-doctor_done {
    background: #28a745;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button,
    .button-group a {
        width: 100%;
    }
}
