/* FilingMate Documentation Styles */
/* Customized from invoice-app to match FilingMate app styling */

/* Font Imports - Roboto to match FilingMate app */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --- Root Variables (Matched to FilingMate app-demo.html) --- */
:root {
    /* FilingMate Primary Colors - Material Blue */
    --color-primary: #1976d2;
    /* Material Blue 700 */
    --color-primary-hover: #1565c0;
    /* Material Blue 800 */
    --color-primary-light: #42a5f5;
    /* Material Blue 400 */

    /* Secondary - Purple */
    --color-secondary: #9c27b0;
    /* Purple 500 */
    --color-secondary-hover: #7b1fa2;
    /* Purple 700 */
    --color-secondary-light: #ab47bc;
    /* Purple 400 */

    /* Status Colors */
    --color-accent: #00acc1;
    /* Cyan 600 */
    --color-success: #2e7d32;
    /* Green 800 */
    --color-warning: #ed6c02;
    /* Orange 700 */
    --color-error: #d32f2f;
    /* Red 700 */
    --color-info: #0288d1;
    /* Light Blue 700 */

    /* Backgrounds */
    --color-background: #f4f6f8;
    /* Grey 50 */
    --color-surface: #ffffff;
    /* White */
    --color-surface-hover: #f5f5f5;
    /* Grey 100 */

    /* Text */
    --color-text: #212121;
    /* Grey 900 */
    --color-text-secondary: #757575;
    /* Grey 600 */
    --color-text-muted: #9e9e9e;
    /* Grey 500 */
    --color-border: #e0e0e0;
    /* Grey 300 */
    --color-divider: rgba(0, 0, 0, 0.12);

    /* Gradients - FilingMate blue style */
    --gradient-primary: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    --gradient-secondary: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);

    /* Shadows - Material Design */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);

    /* Typography - Roboto like FilingMate app */
    --font-sans: 'Roboto', system-ui, -apple-system, sans-serif;
    --font-heading: 'Poppins', system-ui, -apple-system, sans-serif;

    /* Spacing & Radius */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;

    --sidebar-width: 280px;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Global Reset & Base --- */
html {
    scroll-behavior: smooth;
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    overflow-x: hidden;
    font-family: var(--font-sans);
    margin: 0;
    line-height: 1.5;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
}

/* --- Layout --- */
.docs-wrapper {
    display: flex;
    min-height: 100vh;
}

.docs-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    position: fixed;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    padding: var(--spacing-lg);
    transition: transform 0.3s ease;
}

/* Sidebar Styling */
.docs-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
    text-decoration: none;
    color: var(--color-text);
}

.docs-logo {
    width: 32px;
    height: 32px;
}

.docs-title {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--color-primary);
}

.docs-nav-group {
    margin-bottom: var(--spacing-lg);
}

.docs-nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.docs-nav-link {
    display: block;
    padding: 6px 0;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
    border-left: 3px solid transparent;
    padding-left: 10px;
    margin-left: -12px;
}

.docs-nav-link:hover {
    color: var(--color-primary);
}

.docs-nav-link.active {
    color: var(--color-primary);
    font-weight: 600;
    border-left-color: var(--color-primary);
    background: linear-gradient(90deg, rgba(25, 118, 210, 0.08) 0%, transparent 100%);
}

.docs-sub-menu {
    padding-left: 15px;
    margin-top: 2px;
}

/* Main Content */
.docs-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-2xl);
    max-width: 100%;
}

.docs-container {
    max-width: 800px;
    margin: 0 auto;
}

.docs-header {
    margin-bottom: var(--spacing-2xl);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-lg);
}

/* Content Typography */
.docs-h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    line-height: 1.2;
    color: var(--color-primary);
}

.docs-intro {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-top: 3rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    color: var(--color-text);
}

.content h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--color-text);
}

.content p,
.content li {
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
}

.content code {
    background: var(--color-surface-hover);
    padding: 0.2em 0.5em;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    font-family: 'Roboto Mono', 'SF Mono', monospace;
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}

/* --- UI Components (FilingMate Style) --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.625rem 1.25rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: default;
    transition: all var(--transition-fast);
    line-height: 1.25;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-secondary {
    background: white;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-surface-hover);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

/* Badges - FilingMate chip style */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-success {
    background-color: var(--color-success);
    color: white;
}

.badge-warning {
    background-color: var(--color-warning);
    color: white;
}

.badge-danger {
    background-color: var(--color-error);
    color: white;
}

.badge-primary {
    background-color: var(--color-primary);
    color: white;
}

/* Dashboard Cards (FilingMate summary card style) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin: 25px 0;
}

.stat-card {
    background: var(--color-surface);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin: 0 0 var(--spacing-sm) 0;
    font-weight: 400;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    font-family: var(--font-heading);
}

/* Tables (FilingMate data-grid style) */
.modern-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.modern-table th {
    background-color: var(--color-surface-hover);
    padding: 12px 16px;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.modern-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-divider);
    color: var(--color-text);
    font-size: 0.875rem;
    vertical-align: middle;
}

.modern-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.modern-table tr:last-child td {
    border-bottom: none;
}

/* Icon Buttons */
.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 1rem;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Mockup Container */
.ui-mockup {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    padding: 20px;
    border-radius: var(--radius-lg);
    margin: 25px 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.ui-appbar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-primary);
    color: white;
    margin: -20px -20px 20px -20px;
    box-shadow: var(--shadow-sm);
}

.ui-appbar-title {
    font-weight: 500;
    font-size: 1rem;
    font-family: var(--font-sans);
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label,
.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.form-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--color-text);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

/* Filters card */
.filters-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin: 25px 0;
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-end;
    flex-wrap: wrap;
    border: 1px solid var(--color-border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 150px;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* Alerts (FilingMate style) */
.doc-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    background: var(--color-surface);
    font-size: 0.875rem;
}

.doc-alert.info {
    border-color: var(--color-info);
    background: rgba(2, 136, 209, 0.05);
}

.doc-alert.warning {
    border-color: var(--color-warning);
    background: rgba(237, 108, 2, 0.05);
}

.doc-alert.danger {
    border-color: var(--color-error);
    background: rgba(211, 47, 47, 0.05);
}

/* Mobile Header - Hidden on desktop */
.mobile-header {
    display: none;
}

/* Mobile */
@media (max-width: 768px) {
    .docs-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-sidebar .docs-brand {
        display: none;
    }

    .docs-main {
        margin-left: 0;
        padding: var(--spacing-lg);
        padding-top: 20px;
    }

    .mobile-header {
        display: flex;
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        background-color: var(--color-primary);
        color: white;
        box-shadow: var(--shadow-md);
        z-index: 1001;
        padding: 10px 15px;
        align-items: center;
    }

    .hamburger-menu {
        margin-right: 15px;
        cursor: pointer;
        padding: 8px;
        border-radius: var(--radius-sm);
        transition: background-color 0.2s;
    }

    .hamburger-menu:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .bar {
        width: 20px;
        height: 2px;
        background: white;
        margin: 4px 0;
        transition: all 0.3s;
    }

    .mobile-header-title {
        display: none;
    }

    .mobile-header-appname {
        font-weight: 500;
        color: white;
        font-family: var(--font-sans);
        font-size: 1rem;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .ui-mockup {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modern-table {
        min-width: 500px;
    }

    .docs-h1 {
        font-size: 1.75rem;
    }

    .docs-intro {
        font-size: 1rem;
    }

    .content h2 {
        font-size: 1.35rem;
        margin-top: 2rem;
    }

    .content h3 {
        font-size: 1.15rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .filters-card {
        flex-direction: column !important;
        gap: var(--spacing-md) !important;
    }

    .filter-group {
        min-width: 100% !important;
        flex: 1 1 100% !important;
    }

    .docs-nav-link {
        padding: 10px 0;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .btn {
        min-height: 44px;
    }

    .ui-appbar {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .ui-appbar-title {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .docs-main {
        padding: var(--spacing-md);
    }

    .docs-h1 {
        font-size: 1.5rem;
    }

    .mobile-header-appname {
        font-size: 0.875rem;
    }

    .stat-card {
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }

    .stat-value {
        font-size: 1.25rem;
    }
}