/* --- 1. Variables & Reset --- */
:root {
    /* Neutral Dark Grays (Accessible Base) */
    --color-primary-dark: #121212; 
    --color-surface-dark: #242424; 
    --color-header-dark: #1A1A1A; 
    
    /* High Contrast Text */
    --color-text-light: #F0F0F0; 
    --color-text-secondary: #A0A0A0; 
    
    /* Gold Accent (Accessible High Contrast) */
    --color-accent: #FFD700; 

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    --sidebar-width: 250px;
    --spacing-unit: 1rem;
}

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

body {
    font-family: var(--font-body);
    color: var(--color-text-light);
    background-color: var(--color-primary-dark);
    line-height: 1.6;
    display: grid;
    grid-template-areas:
        "header header"
        "content content";
    grid-template-columns: 1fr;
    min-height: 100vh;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    color: var(--color-text-light);
    line-height: 1.2;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

/* --- 2. Header (Sticky Top) --- */
#app-header {
    grid-area: header;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--color-header-dark);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    padding: var(--spacing-unit);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 1px;
}

.header-controls {
    display: flex;
    align-items: center;
}

.search-input {
    padding: 0.5rem 1rem;
    border: 1px solid #333;
    background-color: var(--color-surface-dark);
    color: var(--color-text-light);
    border-radius: 20px;
    width: 160px;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.search-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.8;
}

#menu-toggle-btn {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--color-text-light);
    padding: 0.2rem;
}

/* --- 3. Sidebar (Hidden on Mobile by default) --- */
#sidebar {
    position: fixed;
    top: 0;
    left: -100vw; 
    width: 80vw;
    max-width: var(--sidebar-width);
    height: 100%;
    background-color: var(--color-header-dark);
    z-index: 999;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.6);
    transition: left 0.3s ease-in-out;
    padding-top: 5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid rgba(255,255,255,0.05);
}

#sidebar.open {
    left: 0;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.5rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    
    /* Standardized Divider */
    border-bottom: 1px solid black;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 215, 0, 0.05);
    color: var(--color-accent);
    border-left: 3px solid var(--color-accent);
}

.nav-item .material-icons-outlined {
    margin-right: 0.75rem;
    font-size: 1.3rem;
    color: inherit;
}

.sidebar-footer {
    padding-bottom: 2rem;
}

/* --- 4. Main Content Area --- */
#main-content {
    grid-area: content;
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    margin-top: 3.5rem;
}

.app-card {
    background-color: var(--color-surface-dark);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255,255,255,0.05);
}

/* --- 5. Buttons & Actions --- */
.hero-actions {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.3s;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--color-accent);
    color: #121212;
    border: 2px solid var(--color-accent);
}

.btn-primary:hover {
    background-color: #E6C200;
    border-color: #E6C200;
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-light);
    border: 2px solid var(--color-text-secondary);
}

.btn-secondary:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    background-color: rgba(255, 215, 0, 0.05);
}

.icon-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.icon-btn:hover {
    color: var(--color-accent);
}

/* --- 6. Text Elements & Hero --- */
.hero-section {
    padding: 3rem 2rem;
}

.hero-image {
    display: none; 
}

.tagline {
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.sub-headline {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.description {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    max-width: 800px;
}

.section-heading {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* --- 7. Metrics / Expertise Section --- */
.app-metrics-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.metric-card {
    text-align: center;
    border-top: 4px solid var(--color-accent);
    padding: 1.5rem;
}

.metric-card h3 {
    font-size: 1.1rem;
    color: var(--color-text-light);
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.metric-card p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.icon-large {
    font-size: 2.5rem;
    color: var(--color-accent);
}

/* --- 8. Scripts Grid --- */
.script-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.script-card {
    padding: 1.5rem;
    border-radius: 8px;
    background-color: #292929;
    border: 1px solid rgba(255,255,255,0.08);
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.script-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-2px);
}

.tag {
    display: inline-block;
    background-color: rgba(255, 215, 0, 0.15);
    color: var(--color-accent);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.tag.free {
    background-color: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.3);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-title {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.75rem;
    margin-top: auto;
}

.rating { color: var(--color-accent); font-size: 0.85rem;} 
.price { font-weight: 700; color: var(--color-accent); }
.price.free { color: #4CAF50; }

/* --- 9. Footer --- */
.app-footer {
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    padding-top: 2rem;
    padding-bottom: 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 2rem;
}

.footer-link {
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* --- 10. DESKTOP MEDIA QUERY (App Layout) --- */
@media (min-width: 992px) {
    body {
        grid-template-areas:
            "header header"
            "sidebar content";
        grid-template-columns: var(--sidebar-width) 1fr;
        grid-template-rows: auto 1fr;
    }
    
    #menu-toggle-btn {
        display: none;
    }
    
    #app-header {
        padding-left: calc(var(--sidebar-width) + var(--spacing-unit));
        border-bottom: none;
        box-shadow: none; 
    }

    .search-input {
        width: 300px;
        margin-right: 0;
    }

    #sidebar {
        box-shadow: none;
        grid-area: sidebar;
        position: sticky;
        top: 0;
        left: 0;
        width: var(--sidebar-width);
        padding-top: 1rem;
        background-color: var(--color-header-dark);
        border-right: 1px solid rgba(255,255,255,0.08);
    }

    #main-content {
        margin-top: 0;
        padding-top: 1.5rem;
        padding-right: 3rem;
    }
    
    .app-metrics-section {
        grid-template-columns: repeat(3, 1fr);
    }

    .script-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Desktop Hero Settings */
    .hero-section {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .hero-text {
        flex: 1;
        padding-right: 2rem;
    }

    .hero-image {
        display: block; /* Visible only on Desktop */
        width: 240px;
        height: 240px;
        object-fit: cover;
        border-radius: 12px;
        border: 2px solid var(--color-accent);
    }
}