/* ComicBoox - AROTIP Inspired Theme System */

/* Light Theme Variables (Default) */
:root {
    --primary: #fa4c4c;
    --primary-dark: #f33636;
    --secondary: #E5E7EB;
    --accent: #FF6B6B;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-dark: #374151;
    --text-medium: #6B7280;
    --text-light: #111827;
    --border: #E5E7EB;
    --shadow: rgba(0, 0, 0, 0.15);
    --header-height: 80px;
    --transition-speed: 0.3s;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --primary: #ff6b6b;
    --primary-dark: #ff5252;
    --secondary: #374151;
    --accent: #ff6b6b;
    --background: #111827;
    --surface: #1f2937;
    --text-dark: #f9fafb;
    --text-medium: #d1d5db;
    --text-light: #f3f4f6;
    --border: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--background);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.header {
    background: var(--surface);
    color: var(--text-light);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all var(--transition-speed);
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-brand h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    border-radius: 3px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-menu a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all var(--transition-speed);
}

.nav-menu a:hover {
    color: var(--primary);
    background: rgba(255, 75, 75, 0.1);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 200px;
    background: var(--surface);
    color: var(--text-light);
    transition: all var(--transition-speed);
}

.search-bar::placeholder {
    color: var(--text-medium);
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary);
}

.theme-toggle {
    background: var(--surface);
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-speed);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.cart-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.cart-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.hero {
    background: var(--surface);
    color: var(--text-light);
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 75, 75, 0.1) 0%,
        transparent 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
    color: var(--text-light);
    letter-spacing: -0.025em;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-medium);
    line-height: 1.75;
}

.cta-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.cta-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-light);
    font-weight: 700;
}

.comic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.comic-card {
    background: var(--surface);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all var(--transition-speed);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 480px;
    position: relative;
    cursor: pointer;
}

.comic-card a {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.comic-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px var(--shadow);
    border-color: var(--primary);
}

.comic-image {
    height: 200px;
    background: var(--surface);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.comic-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--surface);
    z-index: 10;
}

.comic-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.comic-fallback.spider-man { background: linear-gradient(135deg, #dc143c, #8b0000); }
.comic-fallback.iron-man { background: linear-gradient(135deg, #ffd700, #ff6347); }
.comic-fallback.batman { background: linear-gradient(135deg, #000000, #2f2f2f); }
.comic-fallback.x-men { background: linear-gradient(135deg, #0066cc, #003d7a); }
.comic-fallback.fantastic-four { background: linear-gradient(135deg, #4169e1, #1e3a8a); }
.comic-fallback.ghost-rider { background: linear-gradient(135deg, #ff4500, #8b0000); }
.comic-fallback.daredevil { background: linear-gradient(135deg, #8b0000, #4b0000); }
.comic-fallback.hulk { background: linear-gradient(135deg, #228b22, #006400); }
.comic-fallback.thor { background: linear-gradient(135deg, #4682b4, #2f4f4f); }
.comic-fallback.captain-america { background: linear-gradient(135deg, #b22222, #8b0000); }
.comic-fallback.wolverine { background: linear-gradient(135deg, #ffff00, #ffa500); }
.comic-fallback.deadpool { background: linear-gradient(135deg, #8b0000, #000000); }
.comic-fallback.punisher { background: linear-gradient(135deg, #000000, #2f2f2f); }
.comic-fallback.black-panther { background: linear-gradient(135deg, #4b0082, #2e0054); }
.comic-fallback.marvel { background: linear-gradient(135deg, #ed1d24, #b71c1c); }
.comic-fallback.dc { background: linear-gradient(135deg, #0078f0, #0056b3); }
.marvel-attribution {
    font-size: 0.7rem;
    color: var(--text-medium);
    margin: 0.5rem 0;
    text-align: center;
}

.marvel-attribution a {
    color: var(--text-medium);
    text-decoration: none;
    font-weight: 500;
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.cart-notification.show {
    transform: translateX(0);
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.cart-modal-content {
    background: var(--surface);
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.cart-header h2 {
    margin: 0;
    color: var(--text-light);
}

.close-cart {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-medium);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.empty-cart {
    text-align: center;
    color: var(--text-medium);
    padding: 2rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.item-info h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-light);
    font-size: 1rem;
}

.item-info p {
    margin: 0;
    color: var(--text-medium);
    font-size: 0.9rem;
}

.item-price {
    font-weight: 600;
    color: var(--primary);
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-controls button {
    background: var(--background);
    border: 1px solid var(--border);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-light);
}

.item-controls button:hover {
    background: var(--border);
}

.remove-btn {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-total {
    font-size: 1.2rem;
    color: var(--text-light);
}

.checkout-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.checkout-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .cart-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .cart-footer {
        flex-direction: column;
        gap: 1rem;
    }
}

.comic-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
}

.comic-card-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.comic-card h3 {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    line-height: 1.3;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 600;
}

.comic-card .publisher {
    color: var(--text-medium);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comic-card .price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.comic-card .grade {
    font-size: 0.8rem;
    color: var(--text-medium);
    background: var(--background);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 1rem;
    font-weight: 600;
    cursor: help;
    border: 1px dashed var(--border);
}

.add-cart {
    width: calc(100% - 2rem);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 1rem 1rem 1rem;
    position: relative;
    z-index: 10;
}

.add-cart:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 75, 75, 0.3);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.category-card {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition-speed);
}

.category-card:hover {
    transform: scale(1.05);
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.category-card p {
    color: rgba(255, 255, 255, 0.9);
}

.collectible-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.collectible-card {
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    border: 2px solid #ffd700;
}

.collectible-image {
    height: 250px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    position: relative;
}

.collectible-image::after {
    content: "💎";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
}

.collectible-card h3 {
    padding: 1rem;
    font-size: 1.3rem;
    color: var(--text-light);
}

.collectible-card .grade {
    padding: 0 1rem;
    color: var(--text-medium);
    font-weight: 600;
}

.collectible-card .price {
    padding: 0 1rem 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.footer {
    background: var(--surface);
    color: var(--text-light);
    padding: 3rem 0 1rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--text-medium);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-section ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border);
    margin-top: 2rem;
    color: var(--text-medium);
}

/* Inventory Page Styles */
.inventory-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.inventory-header {
    text-align: center;
    margin-bottom: 2rem;
}

.inventory-header h1 {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.inventory-stats {
    font-size: 1.2rem;
    color: var(--text-medium);
}

.filters-section {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    box-shadow: 0 2px 10px var(--shadow);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-light);
}

.filter-group select,
.filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--background);
    color: var(--text-light);
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.loading, .error, .no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: var(--text-medium);
}

.error {
    color: var(--primary);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.pagination button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-speed);
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-dark);
}

.pagination button:disabled {
    background: var(--text-medium);
    cursor: not-allowed;
}

#pageInfo {
    font-weight: 600;
    color: var(--text-light);
}

.nav-menu .active {
    color: var(--primary) !important;
    background: rgba(255, 75, 75, 0.1);
}

@media (max-width: 768px) {
    .nav {
        flex-wrap: wrap;
        position: relative;
    }

    .hamburger {
        display: flex;
        order: 2;
    }

    .nav-brand {
        order: 1;
    }

    .nav-actions {
        order: 3;
        gap: 0.5rem;
    }

    .search-bar {
        width: 120px;
        font-size: 0.85rem;
    }

    .nav-menu {
        order: 4;
        flex-direction: column;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        gap: 0;
        background: var(--surface);
        margin-top: 1rem;
        border-radius: 8px;
    }

    .nav-menu.active {
        max-height: 500px;
        padding: 1rem 0;
        border: 1px solid var(--border);
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 1rem 2rem;
        width: 100%;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .comic-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .comic-card {
        height: 380px;
    }

    .comic-card h3 {
        font-size: 0.9rem;
    }

    .filters-section {
        grid-template-columns: 1fr;
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
    }
}
/* Success Page */
.success-container {
    text-align: center;
    max-width: 600px;
    margin: 100px auto;
    padding: 40px 20px;
}

.success-icon {
    font-size: 4em;
    color: var(--success-color);
    margin-bottom: 20px;
}

.success-container h1 {
    color: var(--text-color);
    margin-bottom: 15px;
}

.success-container p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 1.1em;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}


.comic-image:has(img) {
    background: var(--surface) !important;
}

.comic-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.comic-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--surface);
    z-index: 10;
}
