/* style.css - Modern Laravel Guide Theme */

:root {
    /* Brand Colors */
    --primary: #ff2d20;
    --primary-hover: #d61f15;
    --primary-subtle: rgba(255, 45, 32, 0.08);

    /* Light Theme Base */
    --bg-body: #f8fafc; /* Slate 50 */
    --bg-surface: #ffffff;
    --bg-surface-glass: rgba(255, 255, 255, 0.85);

    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */

    --border: #e2e8f0; /* Slate 200 */

    /* Code Blocks Light */
    --code-bg: #1e293b;
    --code-text: #f8fafc;

    /* UI Elements */
    --header-h: 70px;
    --sidebar-w: 280px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md:
        0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-glow: 0 0 15px rgba(255, 45, 32, 0.15);
}

[data-theme="dark"] {
    /* Dark Theme Base */
    --bg-body: #020617; /* Slate 950 */
    --bg-surface: #0f172a; /* Slate 900 */
    --bg-surface-glass: rgba(15, 23, 42, 0.85);

    --text-main: #f1f5f9; /* Slate 100 */
    --text-muted: #94a3b8; /* Slate 400 */

    --border: #1e293b; /* Slate 800 */

    /* Code Blocks Dark */
    --code-bg: #0b1120; /* Almost black */
    --code-text: #e2e8f0;
}

/* --- Reset & Typography --- */
body {
    font-family: "Inter", sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    transition:
        background 0.3s,
        color 0.3s;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    letter-spacing: -0.02em;
}
code,
.code-snippet {
    font-family: "JetBrains Mono", monospace;
}

/* --- Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-w);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.sidebar-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    font-weight: 600;
}

.nav-link {
    color: var(--text-muted);
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    color: var(--primary);
    background-color: var(--primary-subtle);
}

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

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* --- Main Area --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
}

/* Header */
.top-header {
    height: var(--header-h);
    background-color: var(--bg-surface-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.header-left {
    flex: 1;
    max-width: 600px;
}

/* Search */
.search-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 0.5rem 2.5rem;
    border-radius: 99px; /* Pill shape */
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.kbd-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-muted);
    border-radius: 4px;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 600;
    pointer-events: none;
}

/* Theme Toggle & Links */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    transition: all 0.2s;
}
.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-doc-link {
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-main);
    padding: 0.4rem 1rem;
    border-radius: 99px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.btn-doc-link:hover {
    border-color: var(--text-muted);
}

/* --- Content Body --- */
.content-body {
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* Feature Cards (Top) */
.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}
.bg-red-soft {
    background: rgba(255, 45, 32, 0.1);
}
.bg-blue-soft {
    background: rgba(56, 189, 248, 0.1);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* Lists in Cards */
.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.step-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}
.step-num {
    width: 20px;
    height: 20px;
    background: var(--text-main);
    color: var(--bg-surface);
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
    flex-shrink: 0;
}

.code-snippet {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Divider */
.divider-text {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 3rem 0 2rem 0;
}
.divider-text::before,
.divider-text::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.divider-text span {
    padding: 0 1rem;
}

/* --- Commands Section --- */
.category-section {
    scroll-margin-top: 100px;
    margin-bottom: 3rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}
.section-header .icon-box {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.commands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

/* Command Card */
.command-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: stretch; /* Estica altura */
    overflow: hidden;
    transition: all 0.2s;
}

.command-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-content {
    flex: 1;
    padding: 1rem;
    min-width: 0; /* Fix flex overflow */
}

.command-desc {
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.code-wrapper {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}
.code-wrapper::-webkit-scrollbar {
    display: none;
}

.code-line {
    color: var(--text-muted);
}
/* Syntax Highlighting Fake */
.code-line .core {
    color: var(--primary);
    font-weight: 600;
}
.code-line .opt {
    color: #0ea5e9;
} /* Sky Blue */

[data-theme="dark"] .code-wrapper {
    background: #0b1120;
    border-color: #1e293b;
}

/* Copy Button */
.btn-copy {
    width: 44px;
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-copy:hover {
    background-color: var(--bg-body);
    color: var(--primary);
}

.btn-copy.copied {
    background-color: #10b981; /* Emerald 500 */
    color: white;
    border-left-color: #10b981;
}

/* --- Footer & BackToTop --- */
.app-footer {
    text-align: center;
    margin-top: 4rem;
    padding: 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-back-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 45, 32, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 990;
}

.btn-back-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.btn-back-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
}

/* --- Mobile Responsiveness --- */
.backdrop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 950;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.backdrop-overlay.show {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    padding: 0;
}

.btn-close-sidebar {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .top-header {
        padding: 0 1rem;
    }
    .mobile-menu-btn {
        display: block;
    }

    .commands-grid {
        grid-template-columns: 1fr;
    }
    .content-body {
        padding: 1rem;
    }
}
