/* ==========================================================================
   ⚡ Flare Docs Style - Claude.ai Aesthetic (Light & Dark Theme)
   ========================================================================== */

:root {
    --bg-main: #fbfaf7;
    --bg-sidebar: #f5f4f0;
    --bg-card: #ffffff;
    --text-primary: #1b1a17;
    --text-secondary: #6e6b64;
    --border-color: #e5e3dd;
    --accent-color: #b45309;
    --accent-light: #fef3c7;
    
    --code-bg: #1e1e1e;
    --code-text: #f8f8f2;
    --table-header: #f3f1eb;
    
    /* Toast Preset Colors in Simulator */
    --toast-success: #12b76a;
    --toast-error: #f04438;
    --toast-warning: #f79009;
    --toast-info: #0086c9;
    --toast-loading: #475467;
}

.dark-theme {
    --bg-main: #191816;
    --bg-sidebar: #131211;
    --bg-card: #201f1d;
    --text-primary: #e5e4e0;
    --text-secondary: #a39f96;
    --border-color: #2e2d2a;
    --accent-color: #f59e0b;
    --accent-light: #78350f;
    
    --code-bg: #0d0c0b;
    --code-text: #e5e4e0;
    --table-header: #282724;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-main);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.025em;
}

.version-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    background-color: var(--border-color);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    background: none;
    border: 1px solid var(--border-color);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: var(--bg-sidebar);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.moon-icon {
    display: none;
}

.dark-theme .sun-icon {
    display: none;
}

.dark-theme .moon-icon {
    display: block;
}

.github-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--text-primary);
    color: var(--bg-main);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.github-btn:hover {
    opacity: 0.9;
}

.github-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ==========================================================================
   Layout Structure
   ========================================================================== */
.main-layout {
    display: grid;
    grid-template-columns: 260px 1fr 360px;
    min-height: calc(100vh - 70px);
}

@media (max-width: 1100px) {
    .main-layout {
        grid-template-columns: 220px 1fr;
    }
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
}

/* ==========================================================================
   Left Sidebar Navigation
   ========================================================================== */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
}

.menu-section {
    margin-bottom: 2rem;
}

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

.menu-section ul {
    list-style: none;
}

.menu-section li {
    margin-bottom: 0.4rem;
}

.menu-section a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.menu-section a:hover, .menu-section a.active {
    background-color: var(--border-color);
    font-weight: 500;
}

/* ==========================================================================
   Center Documentation reading area
   ========================================================================== */
.content {
    padding: 3rem 4rem;
    overflow-y: auto;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .content {
        padding: 2rem 1.5rem;
    }
}

.doc-section {
    margin-bottom: 4rem;
    scroll-margin-top: 90px;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
}

.hero-title em {
    font-style: italic;
    color: var(--accent-color);
}

.lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.75rem;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    font-size: 0.95rem;
}

ol, ul {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    font-size: 0.95rem;
}

li {
    margin-bottom: 0.5rem;
}

code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background-color: var(--bg-sidebar);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

pre {
    background-color: var(--code-bg);
    padding: 1.25rem;
    border-radius: 10px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

pre code {
    color: var(--code-text);
    background: none;
    padding: 0;
    border: none;
    font-size: 0.85rem;
}

.accent-card {
    background-color: var(--bg-sidebar);
    border-left: 4px solid var(--accent-color);
    padding: 1.25rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 580px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.f-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.feature-card h4 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Tabs */
.tab-container {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.tab-headers {
    display: flex;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
}

.tab-link {
    background: none;
    border: none;
    padding: 0.85rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-color);
    transition: background-color 0.2s, color 0.2s;
}

.tab-link.active {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-weight: 600;
}

.tab-content {
    display: none;
    padding: 1.5rem;
}

.tab-content.active {
    display: block;
}

.tab-content p {
    font-size: 0.9rem;
}

/* Config Table */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th, td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--table-header);
    font-weight: 600;
}

tr:last-child td {
    border-bottom: none;
}

.doc-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

/* ==========================================================================
   Right Sidebar (Android Phone Mockup Simulator)
   ========================================================================== */
.right-sidebar {
    border-left: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    background-color: var(--bg-sidebar);
}

.simulator-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.simulator-wrapper h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0;
}

.sim-help {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0;
}

/* Phone Bezel */
.android-mock {
    width: 260px;
    height: 480px;
    border-radius: 36px;
    background-color: #0c0b0a;
    border: 8px solid #201f1d;
    padding: 6px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    position: relative;
}

.bezel {
    width: 100%;
    height: 100%;
    border-radius: 26px;
    overflow: hidden;
    position: relative;
    border: 3px solid #000;
}

.camera-notch {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 18px;
    border-radius: 9px;
    background-color: #000;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    position: relative;
}

.screen-wallpaper {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    position: relative;
}

.dark-theme .screen-wallpaper {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
}

.mock-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 6px 16px 0 16px;
    color: rgba(255,255,255,0.8);
    font-size: 0.65rem;
    font-weight: 500;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 5;
}

.mock-home-indicator {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: rgba(255,255,255,0.7);
    border-radius: 2px;
    z-index: 5;
}

/* Simulated Alert Toast Box */
.sim-alert {
    position: absolute;
    left: 10px;
    right: 10px;
    border-radius: 12px;
    background-color: var(--toast-info);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    z-index: 10;
}

/* Positions inside Screen */
.sim-alert.pos-top {
    top: 32px;
}

.sim-alert.pos-bottom {
    bottom: 24px;
}

.sim-alert.pos-center {
    top: 50%;
    transform: translateY(-50%) scale(1);
    left: 10px;
    right: 10px;
}

.sim-alert.pos-center.hidden {
    transform: translateY(-50%) scale(0.85);
    opacity: 0;
    pointer-events: none;
}

.sim-alert.hidden {
    opacity: 0;
    pointer-events: none;
}

.sim-alert.pos-top.hidden {
    transform: translateY(-50px);
}

.sim-alert.pos-bottom.hidden {
    transform: translateY(50px);
}

.sim-alert-content {
    display: flex;
    align-items: center;
    padding: 10px;
    gap: 8px;
}

.sim-alert-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sim-alert-text {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.sim-alert-text strong {
    font-size: 0.75rem;
    font-weight: 600;
}

.sim-alert-text p {
    font-size: 0.65rem;
    margin: 0;
    color: rgba(255,255,255,0.9);
    line-height: 1.2;
}

.sim-alert-action {
    background: none;
    border: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.65rem;
    cursor: pointer;
    text-transform: uppercase;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sim-alert-action:hover {
    background-color: rgba(255,255,255,0.15);
}

.sim-alert-progress {
    height: 3px;
    width: 100%;
    background-color: rgba(255,255,255,0.3);
    position: relative;
}

.sim-alert-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #ffffff;
    transform-origin: left;
    transition: transform linear;
}

.sim-alert-progress.anim-run::after {
    transform: scaleX(0);
}

/* Spinner for Loading State */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* Simulator controls styling */
.sim-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 10px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.control-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.control-group select, .control-group input[type="text"] {
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.control-group select:focus, .control-group input[type="text"]:focus {
    border-color: var(--accent-color);
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input {
    cursor: pointer;
}

.checkbox-group label {
    cursor: pointer;
    font-weight: 500;
}

.primary-btn {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 0.65rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: filter 0.2s;
}

.primary-btn:hover {
    filter: brightness(1.1);
}
