/* ============================================================================
   ROOT & GLOBAL VARIABLES
   ========================================================================== */

:root {
    /* Primary Colors */
    --p: #3b82f6;
    --pd: #2563eb;
    --pg: rgba(59, 130, 246, 0.4);
    
    /* Accent Colors */
    --a: #10b981;
    --ag: rgba(16, 185, 129, 0.3);
    
    /* Danger */
    --d: #ef4444;
    
    /* Background Palette */
    --bg: #0a0e1a;
    --bg2: #0f172a;
    --bg3: #1e293b;
    
    /* Text & Borders */
    --txt: #f8fafc;
    --mut: #94a3b8;
    --brd: #334155;
    
    /* Spacing & Shape */
    --r: 16px;
    --rs: 8px;
    
    /* Shadows */
    --sh: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --shxl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    
    /* Transitions */
    --tr: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   BASE STYLES
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--txt);
    background: var(--bg);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--p);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--rs);
    z-index: 1000;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 6px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* ============================================================================
   TYPOGRAPHY
   ========================================================================== */

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--txt) 0%, var(--p) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--p), var(--a));
    border-radius: 2px;
}

h3 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* ============================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.site-header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--p) 0%, var(--a) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: transform var(--tr);
}

.logo:hover,
.logo:focus {
    transform: scale(1.05);
    outline: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--p);
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-menu a {
    color: var(--mut);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    transition: color var(--tr);
    letter-spacing: 0.02em;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--p), var(--a));
    transition: width var(--tr);
}

.nav-menu a:hover,
.nav-menu a:focus {
    color: var(--p);
    outline: none;
}

.nav-menu a:hover::after,
.nav-menu a:focus::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--txt);
    border-radius: 2px;
    transition: all var(--tr);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* ============================================================================
   HERO SECTION
   ========================================================================== */

.hero {
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: 
        linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 50% 0%, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 0.6s ease-out;
}

.hero-desc {
    font-size: 1.2rem;
    color: var(--mut);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   GALLERY SECTION
   ========================================================================== */

.gallery-section {
    padding: 6rem 1.5rem;
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 4rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg3);
    color: var(--mut);
    border: 2px solid var(--brd);
    border-radius: var(--r);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--tr);
    font-size: 0.95rem;
}

.filter-btn:hover,
.filter-btn:focus {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--p);
    color: var(--p);
    outline: none;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--p) 0%, #6366f1 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--r);
    aspect-ratio: 1;
    background: var(--bg3);
    border: 1px solid var(--brd);
    transition: all var(--tr);
    cursor: pointer;
}

.gallery-item:hover,
.gallery-item:focus-within {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shxl);
    border-color: var(--p);
}

.gallery-item-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity var(--tr);
}

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

.gallery-item-info {
    color: #fff;
    margin-bottom: 1rem;
}

.gallery-item-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.category-badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.8);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--p) 0%, #6366f1 100%);
    color: #fff;
    text-decoration: none;
    border-radius: var(--rs);
    font-weight: 600;
    transition: all var(--tr);
    border: none;
    cursor: pointer;
}

.view-btn:hover,
.view-btn:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5);
    outline: none;
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--mut);
    font-size: 1.1rem;
}

/* ============================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 4rem;
}

.pagination-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg3);
    color: var(--txt);
    border: 2px solid var(--brd);
    border-radius: var(--r);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--tr);
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled),
.pagination-btn:focus:not(.disabled) {
    background: var(--p);
    border-color: var(--p);
    color: #fff;
    outline: none;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: var(--mut);
    font-weight: 600;
}

/* ============================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: var(--bg3);
    border-top: 1px solid var(--brd);
    padding: 4rem 1.5rem 2rem;
    margin-top: 6rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: var(--p);
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.footer-section p {
    color: var(--mut);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--mut);
    text-decoration: none;
    transition: color var(--tr);
    font-weight: 500;
}

.footer-links a:hover,
.footer-links a:focus {
    color: var(--p);
    outline: none;
}

.copyright {
    font-size: 0.9rem;
    color: var(--brd);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--brd);
}

.footer-bottom p {
    color: var(--mut);
    font-size: 0.9rem;
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--r);
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transform: translateY(100px);
    transition: all var(--tr);
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: var(--a);
    color: #fff;
}

.toast-error {
    background: var(--d);
    color: #fff;
}

.toast-info {
    background: var(--p);
    color: #fff;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(30, 41, 59, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        transform: translateX(-100%);
        transition: transform var(--tr);
        border-bottom: 1px solid var(--brd);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

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

    .gallery-filters {
        gap: 0.75rem;
        margin-bottom: 2rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .hero {
        padding: 4rem 1rem 3rem;
    }

    .gallery-section {
        padding: 4rem 1rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* ============================================================================
   ACCESSIBILITY & FOCUS STATES
   ========================================================================== */

:focus-visible {
    outline: 3px solid var(--p);
    outline-offset: 3px;
}

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

/* ============================================================================
   REDUCED MOTION SUPPORT
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ============================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .site-header,
    .site-footer,
    .gallery-filters,
    .pagination,
    .nav-toggle {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    body::before {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
