/* PIXVORA DESIGN SYSTEM */

:root {
    /* Color Palette */
    --clr-black: #111111;
    --clr-soft-black: #1A1A1A;
    --clr-white: #FFFFFF;
    --clr-soft-white: #F8F9FA;
    --clr-accent-red: #E63946;
    --clr-accent-red-hover: #D62828;
    --clr-text-main: #333333;
    --clr-text-muted: #6C757D;
    --clr-border: #EAEAEA;

    /* Spacing */
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 32px;
    --space-xl: 64px;

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* UI Elements */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-pill: 50px;

    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.1);

    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--clr-soft-white);
    color: var(--clr-text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--clr-black);
    font-weight: 700;
    line-height: 1.2;
}

.text-center { text-align: center; }
.text-muted { color: var(--clr-text-muted); }

/* Layout Containers */
.container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* Header & Nav */
.header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--clr-border);
    padding: var(--space-md) 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 32px;
}

.nav-links {
    display: none;
    align-items: center;
}

.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--clr-black);
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
        gap: var(--space-lg);
        font-weight: 600;
    }
    .mobile-menu-btn {
        display: none;
    }
}

.nav-links.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--clr-white);
    padding: var(--space-md);
    box-shadow: var(--shadow-soft);
    border-top: 1px solid var(--clr-border);
}

@media (min-width: 1024px) {
    .nav-links.active {
        position: static;
        flex-direction: row;
        width: auto;
        padding: 0;
        box-shadow: none;
        border: none;
        background: transparent;
    }
}

.nav-links a {
    transition: var(--transition-fast);
}
.nav-links a:hover {
    color: var(--clr-accent-red);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

/* Advanced Search UI */
.search-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    padding: var(--space-md) 0;
}

@media (min-width: 1024px) {
    .search-layout {
        flex-direction: row;
    }
}

.search-sidebar {
    width: 100%;
}

@media (min-width: 1024px) {
    .search-sidebar {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 100px;
        height: max-content;
    }
}

.search-results-area {
    flex: 1;
    min-width: 0;
}

.filter-group {
    margin-bottom: var(--space-lg);
}

.filter-group h4 {
    margin-bottom: 12px;
    font-size: 1.05rem;
    color: var(--clr-black);
}

.color-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.color-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}

.color-circle:hover {
    transform: scale(1.1);
}

.color-circle.active {
    border-color: var(--clr-accent-red);
    transform: scale(1.1);
}

.live-suggestions {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--clr-white);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-top: 10px;
    z-index: 1000;
    overflow: hidden;
    display: none;
}

.live-suggestions.active {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--clr-border);
    color: var(--clr-text-main);
    text-decoration: none;
    transition: background 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--clr-soft-white);
}

.suggestion-item img {
    width: 40px; height: 40px;
    border-radius: 6px;
    object-fit: cover;
}

/* Skeleton Loading */
.skeleton-box {
    background: #e0e0e0;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.skeleton-box::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* Image Detail Page Layout */
.image-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

@media (min-width: 1024px) {
    .image-detail-layout {
        grid-template-columns: 1fr 350px;
    }
}

.image-preview-container {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    position: relative;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-container picture, .image-preview-container img {
    max-height: 80vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

.detail-img {
    border-radius: var(--radius-md);
}

/* Blog Cards */
.blog-card {
    background: var(--clr-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.blog-card-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.blog-card-content {
    padding: var(--space-md);
}

.blog-card-content h3 {
    margin-bottom: var(--space-sm);
    font-size: 1.2rem;
}

.blog-card-content p {
    color: var(--clr-text-muted);
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
}

/* Download Modal UI */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

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

.download-modal {
    background: var(--clr-white);
    width: 95%;
    max-width: 900px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 90vh;
}

@media (min-width: 768px) {
    .download-modal { flex-direction: row; }
}

.modal-overlay.active .download-modal {
    transform: translateY(0);
}

.modal-preview-pane {
    background: #f0f0f0;
    padding: var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 250px;
}

@media (min-width: 768px) {
    .modal-preview-pane { width: 45%; min-height: 400px; }
}

.modal-preview-img-wrapper {
    background: #e0e0e0;
    box-shadow: var(--shadow-soft);
    border-radius: 8px;
    overflow: hidden;
    transition: 0.3s ease;
    /* Dimensions applied via JS based on selected ratio */
    width: 200px;
    height: 200px;
}

.modal-preview-img-wrapper img {
    width: 100%; height: 100%; object-fit: cover;
}

.modal-content-pane {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow-y: auto;
}

.modal-close-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 35px; height: 35px;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    z-index: 10;
}

@media (min-width: 768px) {
    .modal-close-btn { top: 20px; right: 20px; }
}

.ratio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: var(--space-md) 0 var(--space-lg);
}

.ratio-card {
    border: 2px solid var(--clr-border);
    border-radius: var(--radius-sm);
    padding: 15px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ratio-card:hover {
    border-color: #ccc;
    background: #fafafa;
}

.ratio-card.active {
    border-color: var(--clr-accent-red);
    background: rgba(230, 57, 70, 0.05);
}

.ratio-icon {
    width: 32px; height: 32px;
    background: #eee;
    border-radius: 6px;
    display: flex; justify-content: center; align-items: center;
    color: #666;
}

.ratio-card.active .ratio-icon {
    background: var(--clr-accent-red);
    color: #fff;
}

/* Transparent PNG Generator System */
.btn-gradient-png {
    background: linear-gradient(135deg, #111 0%, #333 100%);
    color: var(--clr-white);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-gradient-png::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    transition: 0.5s ease;
}

.btn-gradient-png:hover::before {
    left: 150%;
}

.png-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: var(--clr-white);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.png-modal-checkerboard {
    background-color: #f8f9fa;
    background-image: linear-gradient(45deg, #e9ecef 25%, transparent 25%, transparent 75%, #e9ecef 75%, #e9ecef),
                      linear-gradient(45deg, #e9ecef 25%, transparent 25%, transparent 75%, #e9ecef 75%, #e9ecef);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.png-modal-checkerboard img {
    max-height: 40vh;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
}

/* Accessibility */
:focus-visible {
    outline: 3px solid var(--clr-accent-red);
    outline-offset: 2px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    border: none;
}

.btn-primary {
    background-color: var(--clr-accent-red);
    color: var(--clr-white);
}

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

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--clr-black);
    color: var(--clr-black);
}

.btn-outline:hover {
    background-color: var(--clr-black);
    color: var(--clr-white);
}

/* Split Hero Section */
.hero {
    padding: var(--space-xl) 0;
    background: linear-gradient(180deg, var(--clr-soft-white) 0%, var(--clr-white) 100%);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    align-items: center;
}

@media (min-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr 1fr; }
}

.hero-content h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--clr-text-muted);
    margin-bottom: var(--space-lg);
    max-width: 500px;
}

.hero-visual {
    position: relative;
    height: 400px;
}

@media (min-width: 1024px) {
    .hero-visual { height: 600px; }
}

.hero-visual-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    height: 100%;
}

.hero-visual-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    animation: float 20s infinite linear;
}

.hero-visual-col:nth-child(2) {
    animation-direction: reverse;
    animation-duration: 25s;
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-50px); }
    100% { transform: translateY(0); }
}

.hero-visual-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    background: #e0e0e0;
}
.hero-visual-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-box {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 20px 30px;
    font-size: 1.1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--clr-border);
    background: var(--clr-white);
    box-shadow: var(--shadow-soft);
    outline: none;
    transition: var(--transition-fast);
}

.search-input:focus {
    border-color: var(--clr-black);
    box-shadow: var(--shadow-hover);
}

/* Checkerboard for PNGs */
.checkerboard {
    background-color: #ffffff;
    background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0),
                      linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 75%, #f0f0f0 75%, #f0f0f0);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
}

/* Sections */
.section {
    padding: var(--space-xl) 0;
}

.section-header {
    margin-bottom: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Grids */
.masonry-grid {
    column-count: 1;
    column-gap: var(--space-md);
}

@media (min-width: 640px) { .masonry-grid { column-count: 2; } }
@media (min-width: 1024px) { .masonry-grid { column-count: 3; } }
@media (min-width: 1280px) { .masonry-grid { column-count: 4; } }

.masonry-item {
    break-inside: avoid;
    margin-bottom: var(--space-md);
}

/* Cards */
.image-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    background: var(--clr-white);
    box-shadow: var(--shadow-soft);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.image-card img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    color: var(--clr-white);
    opacity: 0;
    transition: var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

/* Slider and Categories */
.category-card {
    min-width: 150px;
    height: 120px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--clr-white);
    box-shadow: var(--shadow-soft);
    text-align: center;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: 1px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--clr-border);
}

.category-card i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--clr-accent-red);
}

.featured-category-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .featured-category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .featured-category-grid { grid-template-columns: repeat(4, 1fr); }
}

.featured-category-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 250px;
}

.featured-category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-category-card:hover img {
    transform: scale(1.05);
}

.featured-category-content {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-md);
    color: var(--clr-white);
}

/* Category Pills */
.category-scroll {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-md);
    scrollbar-width: none; /* Firefox */
}
.category-scroll::-webkit-scrollbar {
    display: none; /* Chrome */
}

.pill {
    white-space: nowrap;
    padding: 8px 16px;
    background: var(--clr-white);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.pill:hover {
    background: var(--clr-black);
    color: var(--clr-white);
    border-color: var(--clr-black);
}

/* Footer */
.footer {
    background: var(--clr-black);
    color: var(--clr-white);
    padding: var(--space-xl) 0 var(--space-lg);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
}

.footer h4 {
    color: var(--clr-white);
    margin-bottom: var(--space-md);
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: var(--space-sm);
}

.footer ul a {
    color: var(--clr-text-muted);
    transition: var(--transition-fast);
}

.footer ul a:hover {
    color: var(--clr-accent-red);
}

/* Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Form inputs for admin */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--clr-black);
}
