/* ========================================
   main.css - Modern Pixel Art Portfolio
   ======================================== */

/* CSS Variables for Theme */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: #1e1e2a;
    --bg-overlay: rgba(10, 10, 15, 0.95);
    --bg-image: #0f0f15;
    
    --text-primary: #f0f0ff;
    --text-secondary: #b0b0d0;
    --text-muted: #8888aa;
    
    --accent-primary: #7c5cff;
    --accent-secondary: #5c4cff;
    --accent-hover: #8c6cff;
    
    --border-color: #2a2a3a;
    --border-light: #3a3a4a;
    
    --success: #4cffb0;
    --warning: #ffcc5c;
    --danger: #ff5c7c;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 16px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-theme {
    /* Light Theme */
    --bg-primary: #f8f9ff;
    --bg-secondary: #f0f2ff;
    --bg-tertiary: #e8eaff;
    --bg-card: #ffffff;
    --bg-overlay: rgba(248, 249, 255, 0.95);
    --bg-image: #f0f2ff;
    
    --text-primary: #1a1a2a;
    --text-secondary: #4a4a6a;
    --text-muted: #6a6a8a;
    
    --accent-primary: #5c4cff;
    --accent-secondary: #4c3cff;
    --accent-hover: #6c5cff;
    
    --border-color: #d0d2e0;
    --border-light: #e0e2f0;
    
    --shadow-sm: 0 2px 8px rgba(92, 76, 255, 0.1);
    --shadow-md: 0 4px 16px rgba(92, 76, 255, 0.15);
    --shadow-lg: 0 8px 32px rgba(92, 76, 255, 0.2);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: var(--transition);
    overflow-x: hidden;
}

body.gallery-page {
    background-color: var(--bg-secondary);
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    background: linear-gradient(135deg, var(--accent-primary), var(--text-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

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

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-overlay);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-pixel {
    color: var(--accent-primary);
    font-size: 1.5rem;
    animation: pixel-pulse 2s infinite;
}

@keyframes pixel-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.25rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-card);
    transform: rotate(15deg);
}

/* Hero Section */
.hero {
    padding: 12rem 0 6rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(0deg, transparent 24%, var(--border-color) 25%, var(--border-color) 26%, transparent 27%, transparent 74%, var(--border-color) 75%, var(--border-color) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, var(--border-color) 25%, var(--border-color) 26%, transparent 27%, transparent 74%, var(--border-color) 75%, var(--border-color) 76%, transparent 77%, transparent);
    background-size: 40px 40px;
    opacity: 0.03;
    pointer-events: none;
}

.hero-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

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

.pixel-accent {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    margin-bottom: 2rem;
    clip-path: polygon(0 0, 100% 0, 100% 75%, 75% 100%, 0 100%);
}

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

.hero-description {
    font-size: 1.125rem;
    max-width: 600px;
    margin-bottom: 2.5rem;
    color: var(--text-secondary);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pixel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    transform: rotate(45deg);
}

.pixel {
    width: 24px;
    height: 24px;
    background-color: var(--border-color);
    transition: var(--transition);
}

.pixel.active {
    background-color: var(--accent-primary);
    animation: pixel-glow 2s infinite alternate;
}

@keyframes pixel-glow {
    from { opacity: 0.6; }
    to { opacity: 1; }
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-secondary {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

/* Sections */
.section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.section-footer {
    text-align: center;
    margin-top: 3rem;
}

/* ========== INDEX.PHP SPECIFIC STYLES ========== */

/* Gallery Preview on Index */
.gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.gallery-item {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    height: 100%;
}

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

.gallery-item-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Image Container for Index */
.image-container {
    flex: 1;
    position: relative;
    height: 280px;
    background-color: var(--bg-image);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1rem;
}

.image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Styles for Index */
.portfolio-image, .cc0-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
    transition: transform 0.5s ease;
    border-radius: 4px;
}

/* Handle different aspect ratios for Index */
.image-wrapper.wide-image img {
    max-width: 95%;
    max-height: 85%;
}

.image-wrapper.tall-image img {
    max-width: 85%;
    max-height: 95%;
}

.image-wrapper.large-image img {
    max-width: 90%;
    max-height: 90%;
}

.gallery-item:hover .portfolio-image,
.gallery-item:hover .cc0-image {
    transform: scale(1.02);
}

/* Image Overlay for Index */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    pointer-events: none;
}

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

.overlay-content h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.overlay-content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.image-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.year, .license-badge, .dimensions {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.year, .license-badge {
    background-color: var(--accent-primary);
    color: white;
}

.dimensions {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.download-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    background-color: var(--success);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
    pointer-events: auto;
    z-index: 2;
}

.download-btn:hover {
    transform: scale(1.1);
    color: var(--bg-primary);
}

/* CC0 Section on Index */
.cc0-section {
    background-color: var(--bg-secondary);
    position: relative;
}

.license-info {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    margin-top: 1rem;
}

.license-info i {
    color: var(--success);
}

/* About Section on Index */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.skill-tag:hover {
    background-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.about-contact {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
}

.about-contact h3 {
    margin-bottom: 1.5rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-item i {
    width: 20px;
    color: var(--accent-primary);
}

.contact-note {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ========== GALLERY.PHP SPECIFIC STYLES ========== */

/* Gallery Page Header */
.gallery-header {
    padding: 10rem 0 3rem;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.gallery-title {
    text-align: center;
    margin-bottom: 1rem;
}

.gallery-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.item-count {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Gallery Controls */
.gallery-controls {
    margin-top: 3rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.search-form {
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 0.5rem;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.search-box i {
    padding: 0 1rem;
    color: var(--text-muted);
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 1rem 2rem;
    background-color: var(--accent-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.clear-search {
    padding: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.clear-search:hover {
    color: var(--danger);
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 1rem 2rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.filter-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

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

/* Full Gallery Grid */
.full-gallery {
    padding: 3rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2rem;
    align-items: start;
}

.gallery-item-full {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

/* Image Container for Gallery */
.image-container-full {
    position: relative;
    height: 320px;
    background-color: var(--bg-image);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem;
}

/* Image Wrapper for Gallery */
.image-wrapper-full {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image Styles for Gallery */
.gallery-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
    transition: transform 0.5s ease;
    border-radius: 4px;
}

/* Handle different aspect ratios for Gallery */
.image-wrapper-full.wide-image .gallery-image {
    max-width: 95%;
    max-height: 85%;
}

.image-wrapper-full.tall-image .gallery-image {
    max-width: 85%;
    max-height: 95%;
}

.image-wrapper-full.large-image .gallery-image {
    max-width: 90%;
    max-height: 90%;
}

.gallery-item-full:hover .gallery-image {
    transform: scale(1.03);
}

/* Image Overlay for Gallery */
.image-overlay-full {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.95) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    pointer-events: none;
}

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

.overlay-content-full h3 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.overlay-content-full p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.item-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.item-type {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.item-type.protected {
    background-color: rgba(255, 92, 124, 0.2);
    color: var(--danger);
}

.item-type.free {
    background-color: rgba(76, 255, 176, 0.2);
    color: var(--success);
}

.item-year, .item-dimensions {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.download-btn-full {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: var(--success);
    color: var(--bg-primary);
    border-radius: var(--border-radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    pointer-events: auto;
    z-index: 2;
}

.download-btn-full:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--bg-primary);
}

/* Item Info for Gallery */
.item-info {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-card);
    flex-grow: 1;
}

.item-info-left {
    flex: 1;
    min-width: 0;
}

.item-info-left h4 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-info-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-shrink: 0;
    margin-left: 1rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.protected {
    background-color: rgba(255, 92, 124, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 92, 124, 0.3);
}

.badge.free {
    background-color: rgba(76, 255, 176, 0.1);
    color: var(--success);
    border: 1px solid rgba(76, 255, 176, 0.3);
}

.dimensions-badge {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 6rem 2rem;
}

.no-results i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.no-results h3 {
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Pagination & Load More */
.pagination {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    gap: 1.5rem;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.load-more-container {
    text-align: center;
}

.load-more-btn {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.load-more-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Protection Overlay */
.protection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 15, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.protected-image:hover + .protection-overlay,
.protection-overlay:hover {
    opacity: 1;
}

.protection-overlay i {
    font-size: 2rem;
    color: var(--danger);
}

/* Lightbox Modal */
.lightbox-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(10, 10, 15, 0.98);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 2rem;
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
}

.lightbox-close:hover {
    background-color: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.lightbox-image-container {
    flex: 1;
    min-height: 60vh;
    max-height: 70vh;
    background-color: var(--bg-image);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 2rem;
    position: relative;
}

#lightboxImage {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    -ms-interpolation-mode: nearest-neighbor;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.lightbox-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-image);
    color: var(--accent-primary);
    font-size: 2rem;
}

.lightbox-info {
    padding: 2rem;
    background-color: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.lightbox-info h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.lightbox-info p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.lightbox-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.lightbox-meta span {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Footer */
.footer {
    background-color: var(--bg-tertiary);
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    width: 100%;
    text-align: center;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container, .nav-container, .hero-container {
        padding: 0 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .pixel-grid {
        transform: none;
        justify-content: center;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
    
    .image-container-full {
        height: 280px;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .container, .nav-container, .hero-container {
        padding: 0 1.25rem;
    }
    
    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }
    
    .hero {
        padding: 8rem 0 4rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons a {
        width: 100%;
        justify-content: center;
    }
    
    .gallery-preview, .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .filter-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-btn {
        justify-content: center;
        width: 100%;
    }
    
    .search-box {
        flex-wrap: wrap;
        padding: 0.25rem;
    }
    
    .search-input {
        min-width: 100%;
        order: 1;
        padding: 0.75rem;
    }
    
    .search-btn {
        order: 2;
        flex: 1;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .clear-search {
        order: 3;
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .image-container {
        height: 220px;
        padding: 0.75rem;
    }
    
    .image-container-full {
        height: 250px;
        padding: 1rem;
    }
    
    .item-info {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .item-info-right {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    
    .lightbox-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .lightbox-image-container {
        min-height: 50vh;
        max-height: 60vh;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    .gallery-preview {
        grid-template-columns: 1fr;
    }
    
    .image-container {
        height: 200px;
    }
    
    .image-container-full {
        height: 220px;
    }
    
    .logo-text {
        font-size: 1rem;
    }
    
    .nav-links {
        font-size: 0.8rem;
        gap: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
}

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

/* Focus Styles */
button:focus,
input:focus,
a:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .main-nav,
    .theme-toggle,
    .hero-buttons,
    .section-footer,
    .footer,
    .download-btn,
    .image-overlay,
    .image-overlay-full,
    .protection-overlay,
    .filter-buttons,
    .search-form {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 1rem !important;
    }
    
    .image-container, .image-container-full {
        page-break-inside: avoid;
        break-inside: avoid;
    }
    
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}