/* 
 * Comic Book Store - Main Stylesheet
 * Version: 1.0.0
 */

:root {
    /* Color Palette - Light Mode */
    --color-primary: #DC2626;
    /* Comic Red */
    --color-secondary: #2563EB;
    /* Hero Blue */
    --color-accent: #FACC15;
    /* Yellow Pop */
    --color-background: #F8FAFC;
    --color-surface: #FFFFFF;
    --color-text-primary: #0F172A;
    --color-text-secondary: #475569;
    --color-border: #E2E8F0;

    /* Typography */
    --font-heading: 'Bebas Neue', display, sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing & Layout */
    --container-width: 1280px;
    --header-height: 80px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-comic: 4px 4px 0px 0px var(--color-primary);
    /* Comic style hard shadow for accents */
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-primary {
    color: var(--color-primary) !important;
}

.text-center {
    text-align: center !important;
}

.text-secondary {
    color: var(--color-secondary) !important;
}

.text-accent {
    color: var(--color-accent) !important;
}

.bg-surface {
    background-color: var(--color-surface);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    box-shadow: 0 4px 0 0 #991B1B;
    /* Darker red */
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--color-secondary);
    color: white;
    border-color: var(--color-secondary);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

.btn-outline:hover {
    background-color: var(--color-text-primary);
    color: var(--color-background);
}

/* Header & Navbar */
.navbar {
    height: var(--header-height);
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

.logo span {
    color: var(--color-text-primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    font-weight: 500;
    font-size: 1rem;
    color: var(--color-text-primary);
    position: relative;
    padding-bottom: 0.25rem;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link.active {
    color: var(--color-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-primary);
}

/* Dropdown Menu - Added */
.dropdown {
    position: relative;
    padding: 1rem 0;
    /* Add padding to increase hover area */
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--color-surface);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    z-index: 1001;
    /* Ensure on top */
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--color-text-primary);
    font-weight: 500;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--color-background);
    color: var(--color-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Icon Buttons */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--color-background);
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Theme Toggle Button - Enhanced Design */
#theme-toggle {
    position: relative;
    overflow: hidden;
}

#theme-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--color-primary);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
}

#theme-toggle:hover::before {
    width: 100%;
    height: 100%;
    opacity: 0.1;
}

#theme-toggle #theme-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle #theme-icon svg {
    transition: transform 0.3s ease;
}

#theme-toggle:hover #theme-icon svg {
    transform: rotate(15deg);
}

/* Glassmorphism Classes (Restricted use) */
.glass-panel {
    background: rgba(255, 255, 255, 0.08);
    /* Fallback */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Cards (Product / Comic) */
.comic-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.comic-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.comic-image-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 150%;
    /* 2:3 aspect ratio standardized */
}

.comic-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.comic-card:hover .comic-image {
    transform: scale(1.05);
}

.comic-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.comic-category {
    color: var(--color-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.comic-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-primary);
}

.comic-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
    margin-top: auto;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 6rem 0;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 600px;
    z-index: 2;
}

.hero h1 {
    font-size: 5rem;
    line-height: 0.9;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 0px var(--color-background);
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background-color: var(--color-surface);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.footer-heading {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--color-text-secondary);
}

.footer-links a:hover {
    color: var(--color-primary);
}

/* Forms */
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-background);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Auth Pages */
.auth-wrapper {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--color-background);
}

.auth-card {
    background: var(--color-surface);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

/* Mobile Menu Toggle Button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-primary);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1002;
}

.mobile-toggle:hover {
    color: var(--color-primary);
}

/* Responsive adjustments */
@media (max-width: 1024px) {

    /* Tablet and below */
    .mobile-toggle {
        display: block;
    }

    .navbar .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
        gap: 0;
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        z-index: 1001;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }

    .navbar .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .navbar .nav-links .nav-link {
        width: 100%;
        padding: 1rem 0;
        border-bottom: 1px solid var(--color-border);
        display: block;
    }

    .navbar .nav-links .nav-link:last-child {
        border-bottom: none;
    }

    /* Keep theme toggle and cart visible, hide Login and Sign Up on mobile */
    .navbar .nav-actions .nav-link,
    .navbar .nav-actions .btn {
        display: none;
    }

    .navbar .nav-actions .btn-icon {
        display: flex;
    }

    /* Dropdown menu adjustments for mobile */
    .dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--color-border);
        margin-top: 0.5rem;
        padding-left: 1rem;
        display: none;
    }

    .dropdown.active .dropdown-menu {
        display: block;
    }

    .dropdown .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .navbar .nav-actions {
        gap: 0.5rem;
    }
}