/* ============================================
   ClinicDiary User Guide - Modern Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #0ea5e9;
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-gray: #f1f5f9;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-width: 280px;
    --header-height: 60px;
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-dark);
    background: var(--bg-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

strong {
    font-weight: 600;
}

/* ============================================
   Mobile Header
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    align-items: center;
    gap: 1rem;
    z-index: 100;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-dark);
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
}

.nav-section {
    padding: 1.25rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9375rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: var(--bg-gray);
    color: var(--text-dark);
}

.nav-link.active {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-icon {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

.support-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
}

.support-link:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-light);
}

.content-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 3rem;
    border-bottom: 1px solid var(--border);
}

.content-section:last-of-type {
    border-bottom: none;
}

/* Section Header */
.section-header {
    margin-bottom: 2.5rem;
}

.section-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 100px;
    margin-bottom: 1rem;
}

.section-header h1,
.section-header h2 {
    margin-bottom: 1rem;
}

.section-intro {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 0;
}

/* ============================================
   Feature Cards
   ============================================ */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.feature-card {
    background: var(--bg-white);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ============================================
   Callouts
   ============================================ */
.callout {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.callout-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.callout-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.callout-content p {
    font-size: 0.9375rem;
    margin-bottom: 0;
    color: inherit;
}

.callout-info {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
}

.callout-info .callout-content {
    color: var(--primary-dark);
}

.callout-warning {
    background: #fef3c7;
    border-left: 4px solid var(--warning);
}

.callout-warning .callout-content {
    color: #92400e;
}

/* ============================================
   Steps
   ============================================ */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.steps-container.compact {
    gap: 0.75rem;
}

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.steps-container.compact .step-number {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
}

.step-content {
    flex: 1;
    padding-top: 0.25rem;
}

.step-content h4 {
    margin-bottom: 0.25rem;
}

.step-content p {
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ============================================
   Subsections
   ============================================ */
.subsection {
    margin: 2.5rem 0;
}

.subsection h3 {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

/* ============================================
   Numbered List
   ============================================ */
.numbered-list {
    list-style: none;
    counter-reset: item;
    margin: 1rem 0;
}

.numbered-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    counter-increment: item;
}

.numbered-list li::before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Feature List
   ============================================ */
.feature-list {
    list-style: none;
    margin: 1rem 0;
}

.feature-list li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   Roles Grid
   ============================================ */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.role-card {
    background: var(--bg-white);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.role-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.role-badge.receptionist {
    background: #dbeafe;
    color: #1e40af;
}

.role-badge.practitioner {
    background: #d1fae5;
    color: #065f46;
}

.role-badge.manager {
    background: #ede9fe;
    color: #5b21b6;
}

.role-card h3 {
    margin-bottom: 0.5rem;
}

.role-card > p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.role-permissions {
    list-style: none;
}

.role-permissions li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.role-permissions .check {
    color: var(--success);
    font-weight: 600;
}

.role-permissions .cross {
    color: var(--danger);
    font-weight: 600;
}

/* ============================================
   Info Block
   ============================================ */
.info-block {
    background: var(--bg-white);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1.5rem 0;
}

.info-block h3 {
    margin-bottom: 1rem;
}

.info-block p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Demo Elements
   ============================================ */
.action-buttons-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.demo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-gray);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.status-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.status-badge.scheduled {
    background: #e0f2fe;
    color: #0369a1;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.noshow {
    background: #fef3c7;
    color: #92400e;
}

.status-item p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* ============================================
   Filter Demo
   ============================================ */
.filter-demo {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.filter-chip {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--bg-gray);
    border-radius: 100px;
    font-size: 0.875rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   Info Columns
   ============================================ */
.info-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.info-column h4 {
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.info-column ul {
    list-style: none;
}

.info-column li {
    padding: 0.25rem 0;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* ============================================
   Note Fields
   ============================================ */
.note-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.note-field {
    background: var(--bg-white);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.note-field h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.note-field p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ============================================
   Tips Grid
   ============================================ */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tip-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    transition: var(--transition);
}

.tip-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.tip-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.tip-card h4 {
    margin-bottom: 0.5rem;
}

.tip-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ============================================
   Help Section
   ============================================ */
.help-section {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 4rem 2rem;
    text-align: center;
}

.help-content {
    max-width: 500px;
    margin: 0 auto;
}

.help-content h2 {
    color: white;
    margin-bottom: 0.5rem;
}

.help-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.help-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #25d366;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.help-button:hover {
    background: #22c35e;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ============================================
   Footer
   ============================================ */
.guide-footer {
    padding: 2rem;
    text-align: center;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
}

.guide-footer p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .content-section {
        padding: 3rem 2rem;
    }
}

@media (max-width: 768px) {
    /* Show mobile header */
    .mobile-header {
        display: flex;
    }
    
    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Adjust main content */
    .main-content {
        margin-left: 0;
        padding-top: var(--header-height);
    }
    
    .content-section {
        padding: 2rem 1.5rem;
    }
    
    /* Typography adjustments */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .section-intro {
        font-size: 1rem;
    }
    
    /* Grid adjustments */
    .feature-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .roles-grid {
        grid-template-columns: 1fr;
    }
    
    .info-columns {
        grid-template-columns: 1fr;
    }
    
    .note-fields {
        grid-template-columns: 1fr 1fr;
    }
    
    .tips-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Step adjustments */
    .step-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 1.5rem 1rem;
    }
    
    .feature-cards,
    .note-fields,
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .status-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .action-buttons-demo {
        flex-direction: column;
    }
    
    .demo-btn {
        justify-content: center;
    }
    
    .callout {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .step {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .step-content {
        padding-top: 0;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .sidebar,
    .mobile-header,
    .help-section {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-section {
        page-break-inside: avoid;
    }
}

/* ============================================
   Animation Utilities
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
