/* ========================================
   Admin Panel CSS
   Dr. Theodoridis Website Administration
   ======================================== */

:root {
    --primary-color: #f08143;
    --primary-dark: #6d3d21;
    --primary-light: #818cf8;
    --accent-color: #e0e7ff;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --sidebar-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border-color: #e5e7eb;
    --success-color: #16a34a;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --info-color: #0891b2;

    /* Typography */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Base font size */
    --font-size-base: 16px;
    --font-size-sm: 14px;
    --font-size-xs: 12px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 30px;

    /* Spacing */
    --sidebar-width: 260px;
    --header-height: 60px;
    --card-radius: 12px;
    --btn-radius: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Base Styles
   ======================================== */

html {
    font-size: var(--font-size-base);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-light);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.75rem;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   Auth Pages (Login, Forgot, Reset)
   ======================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 2rem;
}

.auth-card {
    background: var(--bg-white);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    max-height: 60px;
    width: auto;
}

.auth-logo h1 {
    font-size: var(--font-size-xl);
    color: var(--primary-dark);
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.auth-logo p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin: 0;
}

.auth-title {
    font-size: var(--font-size-2xl);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ========================================
   Form Styles
   ======================================== */

.form-label {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--btn-radius);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.form-text {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.invalid-feedback {
    font-size: var(--font-size-sm);
}

/* Input with icon */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper .form-control {
    padding-left: 3rem;
}

.input-icon-wrapper .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* ========================================
   Button Styles
   ======================================== */

.btn {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--btn-radius);
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-secondary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-dark);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background-color: #9aacbb;
    border-color: #9aacbb;
    color: var(--primary-dark);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--font-size-lg);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
}

/* ========================================
   Alert Styles
   ======================================== */

.alert {
    border-radius: var(--btn-radius);
    border: none;
    padding: 1rem 1.25rem;
    font-size: var(--font-size-sm);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

/* ========================================
   Auth Page Additional Styles
   ======================================== */

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    font-size: var(--font-size-sm);
    color: var(--primary-color);
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

/* Remember me checkbox */
.form-check {
    /* padding-left: 1.75rem; */
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
    border: 2px solid var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(60, 77, 92, 0.1);
}

.form-check-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ========================================
   Utilities
   ======================================== */

.text-primary { color: var(--primary-color) !important; }
.text-muted { color: var(--text-muted) !important; }
.bg-light { background-color: var(--bg-light) !important; }

.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 575.98px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-title {
        font-size: var(--font-size-xl);
    }
}

/* ========================================
   Admin Layout (Sidebar + Main)
   ======================================== */

.admin-body {
    min-height: 100vh;
    background: var(--bg-light);
}

/* ─── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand-row {
    margin-bottom: 2rem;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}

.sidebar-brand-name {
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

/* Sidebar nav links — scoped to avoid conflict with Bootstrap .nav-link */
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.935rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.sidebar .nav-link:hover {
    background-color: #f3f4f6;
    color: var(--text-primary);
}

.sidebar .nav-link.active {
    background-color: #eef2ff;
    color: var(--primary-color);
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0;
}

/* Sidebar user avatar */
.sidebar-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--accent-color);
    color: var(--primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logout-btn {
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: color 0.2s;
    text-decoration: none;
}

.sidebar-logout-btn:hover {
    color: var(--text-primary);
}

/* ─── Mobile overlay ──────────────────────────────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
}

.sidebar-overlay.show {
    display: block;
}

/* ─── Mobile topbar ───────────────────────────────────────────────────── */

.mobile-topbar {
    display: none;
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.topbar-brand-icon-inner {
    font-size: 1rem;
    line-height: 1;
}

.mobile-menu-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.mobile-menu-btn:hover {
    background: #f3f4f6;
}

.sidebar-close-btn {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    border-radius: 6px;
    line-height: 1;
    display: flex;
    align-items: center;
}

.sidebar-close-btn:hover {
    background: #f3f4f6;
    color: var(--text-primary);
}

/* ─── Main Content Area ────────────────────────────────────────────────── */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2.5rem;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: var(--font-size-2xl);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: var(--bg-white);
    border: 1px solid #f3f4f6;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* ========================================
   Photo Preview
   ======================================== */

.photo-preview {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--bg-light);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 4rem;
}

/* ========================================
   Language Tabs
   ======================================== */

.lang-tabs {
    border-bottom: 2px solid var(--border-color);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.lang-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.lang-tabs .nav-link:hover {
    color: var(--text-primary);
    border-color: transparent;
}

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

.lang-flag {
    font-size: 1.25rem;
}

.tab-content {
    padding-top: 0.5rem;
}

/* ========================================
   Form Actions
   ======================================== */

.form-actions {
    padding: 1.5rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

/* ========================================
   Table
   ======================================== */

.table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    background: var(--bg-light);
}

#postsTableBody td {
    vertical-align: middle;
}

/* ========================================
   Utility Classes
   ======================================== */

.extra-small { font-size: 0.75rem; }
.text-10     { font-size: 10px; }
.text-9      { font-size: 9px; }
.ls-wide     { letter-spacing: 0.05em; }

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 700;
    margin: 0;
}

.doctor-selector {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.call-outcome-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.outcome-success { background: #dcfce7; color: #166534; }
.outcome-urgent  { background: #fee2e2; color: #991b1b; }
.outcome-info    { background: #e0e7ff; color: #3730a3; }

.border-s-danger  { border-left: 4px solid #ef4444 !important; }
.border-s-warning { border-left: 4px solid #f97316 !important; }

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 1.25rem;
    }

    .mobile-topbar {
        display: flex;
    }

    .page-title {
        font-size: var(--font-size-xl);
    }

    .card-header {
        padding: 1rem 1.25rem;
    }

    .card-body {
        padding: 1.25rem;
    }

    .photo-preview {
        width: 150px;
        height: 150px;
    }
}