/* ===================================
   OboiWall - Custom Styles
   Modern Wallpaper Gallery Site
   =================================== */

/* ===== Variables ===== */
:root {
    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --accent-color: #4a90e2;
    --accent-hover: #357abd;
    --border-color: #dee2e6;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --overlay-bg: rgba(0, 0, 0, 0.6);
}

/* Dark Theme Colors */
[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --accent-color: #5ba3f5;
    --accent-hover: #4a90e2;
    --border-color: #404040;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.5);
    --overlay-bg: rgba(0, 0, 0, 0.75);
}

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-primary);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ===== Navigation ===== */
.navbar {
    background-color: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary) !important;
}

.brand-logo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-primary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color) !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 2px;
    background-color: var(--accent-color);
}

#themeToggle {
    border-color: var(--border-color);
    color: var(--text-primary);
    background-color: transparent;
}

#themeToggle:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent-color);
}

/* ===== Hero Section ===== */
.hero-section {
    padding: 6rem 0 4rem;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-buttons .btn {
    margin: 0.5rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-outline-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hero-stats {
    margin-top: 3rem;
}

.hero-stats h3 {
    font-size: 2rem;
    color: var(--accent-color);
}

.hero-stats p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ===== Categories Section ===== */
.categories-section {
    background-color: var(--bg-secondary);
}

.category-filters {
    margin-top: 1rem;
}

.category-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}

.category-filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.category-filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.category-icon-sm {
    font-size: 1.1rem;
    line-height: 1;
}

/* ===== Gallery Section ===== */
.gallery-section {
    background-color: var(--bg-primary);
}

/* Masonry Grid Layout using CSS Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 10px;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

/* Vary heights for masonry effect */
.gallery-item:nth-child(5n+1) {
    grid-row-end: span 30;
}

.gallery-item:nth-child(5n+2) {
    grid-row-end: span 35;
}

.gallery-item:nth-child(5n+3) {
    grid-row-end: span 28;
}

.gallery-item:nth-child(5n+4) {
    grid-row-end: span 32;
}

.gallery-item:nth-child(5n+5) {
    grid-row-end: span 36;
}

.gallery-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Gallery Hidden (filter) */
.gallery-item.gallery-hidden {
    display: none !important;
}

/* Download Counter Badge */
.download-counter {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(4px);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Download Button */
.btn-download {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-download:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-download svg {
    width: 20px;
    height: 20px;
}

/* ===== Contact Section ===== */
.contact-section {
    background-color: var(--bg-secondary);
}

.contact-info {
    margin-top: 2rem;
    padding: 2rem;
    background-color: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.contact-info a {
    color: var(--accent-color);
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
    background-color: #212529 !important;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }

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

    .category-card {
        padding: 1.5rem 1rem;
    }

    .category-icon {
        font-size: 2.5rem;
    }

    .footer .col-md-6 {
        text-align: center !important;
        margin-bottom: 1rem;
    }

    .footer .col-md-6:last-child {
        margin-bottom: 0;
    }
}

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

    .nav-link {
        padding: 0.5rem 0 !important;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }
}

/* ===== Smooth Transitions ===== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Loading State (Optional) ===== */
img[loading="lazy"] {
    background-color: var(--bg-secondary);
    background-image: linear-gradient(90deg, var(--bg-secondary) 0px, var(--border-color) 40px, var(--bg-secondary) 80px);
    background-size: 600px;
    animation: shimmer 1.5s infinite linear;
}

@keyframes shimmer {
    0% {
        background-position: -600px 0;
    }
    100% {
        background-position: 600px 0;
    }
}

/* ===== Dark Theme Adjustments ===== */
[data-theme="dark"] .navbar {
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-secondary) !important;
}

/* ===== Accessibility ===== */
:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ===== Cookie Consent Banner ===== */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-top: 2px solid var(--accent-color);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 1.5rem 0;
    z-index: 9999;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-consent p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.cookie-consent a {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 500;
}

.cookie-consent a:hover {
    color: var(--accent-hover);
}

.cookie-consent .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.cookie-consent .btn-primary {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.cookie-consent .btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
}

.cookie-consent .btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.cookie-consent .btn-outline-secondary:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Mobile adjustments for cookie consent */
@media (max-width: 768px) {
    .cookie-consent {
        padding: 1rem 0;
    }

    .cookie-consent p {
        font-size: 0.85rem;
        margin-bottom: 1rem !important;
    }

    .cookie-consent .btn {
        width: 48%;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* ===== Legal Pages Styles ===== */
.legal-content {
    font-size: 1rem;
    line-height: 1.8;
}

.legal-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

.legal-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.legal-content p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.legal-content ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.legal-content ul li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.legal-content a {
    color: var(--accent-color);
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--accent-hover);
}

.legal-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Search Box ===== */
.search-box .form-control {
    border-radius: 50px 0 0 50px;
    border-color: var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding-left: 1.5rem;
}

.search-box .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.15);
}

.search-box .btn {
    border-radius: 0 50px 50px 0;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

[data-theme="dark"] .search-box .form-control {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .search-box .form-control::placeholder {
    color: var(--text-secondary);
}

/* ===== Modal Dark Theme ===== */
[data-theme="dark"] .modal-content {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .modal-header {
    border-color: var(--border-color);
}

[data-theme="dark"] .modal-footer {
    border-color: var(--border-color);
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

/* ===== Print Styles ===== */
@media print {
    .navbar,
    .hero-buttons,
    .footer,
    #themeToggle,
    .cookie-consent {
        display: none;
    }

    .gallery-item {
        break-inside: avoid;
    }
}