/* ========================================
   Textures Page Styles
   Flip Card Gallery
======================================== */

/* Hero Section */
.textures-hero {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 5% 60px;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.7)), url('assets/textures-banner.png');
    background-size: cover;
    background-position: center;
    text-align: center;
}

.textures-hero-content {
    max-width: 800px;
}

.textures-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.textures-title .highlight {
    color: #64748B;
    font-style: italic;
}

.textures-intro {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    max-width: 600px;
    margin: 0 auto;
}

/* Controls Section */
.controls-section {
    padding: 40px 5% 20px;
    background: #0a0a0a;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.controls-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* Search Bar */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 54px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-input:focus {
    border-color: #64748B;
    background: rgba(255, 255, 255, 0.08);
}

/* Filter Tags */
.filter-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tag {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 10px 22px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    border-color: #64748B;
    color: #64748B;
}

.filter-tag.active {
    background: #64748B;
    border-color: #64748B;
    color: #fff;
}

/* Textures Section */
.textures-section {
    padding: 40px 5% 80px;
    background: #0a0a0a;
    min-height: 60vh;
}

.textures-count {
    max-width: 1400px;
    margin: 0 auto 30px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.textures-count span {
    color: #64748B;
    font-weight: 600;
}

/* Textures Grid */
.textures-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    max-width: 400px;
    margin: 0 auto;
}

.no-results svg {
    width: 60px;
    height: 60px;
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 20px;
}

.no-results p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ========================================
   Flip Card Component
======================================== */

.texture-card {
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    padding-bottom: 140%; /* 3:4.2 aspect ratio - vertical rectangle */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

/* Desktop hover flip */
@media (hover: hover) {
    .texture-card:hover .card-inner {
        transform: rotateY(180deg);
    }
}

/* Mobile tap flip */
.texture-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
}

.card-front {
    transform: rotateY(0deg);
}

/* Card Front */
.card-front {
    background: #fff;
    display: flex;
    flex-direction: column;
}

.card-image {
    flex: 1;
    overflow: hidden;
    background: #f5f5f5;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.texture-card:hover .card-image img {
    transform: scale(1.05);
}

.card-info {
    padding: 14px 16px;
    background: #fff;
}

.card-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-code {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    color: #64748B;
    font-weight: 500;
}

/* Card Back */
.card-back {
    background: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.barcode-wrapper {
    width: 100%;
    max-width: 180px;
    margin-bottom: 16px;
}

.barcode-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.scan-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.back-code {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* ========================================
   Responsive Design
======================================== */

@media (max-width: 1200px) {
    .textures-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .textures-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .textures-hero {
        min-height: 35vh;
        padding: 120px 5% 50px;
    }
    
    .controls-section {
        padding: 30px 5% 20px;
    }
    
    .filter-tags {
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-tag {
        flex-shrink: 0;
    }
    
    .textures-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .card-info {
        padding: 12px 14px;
    }
    
    .card-name {
        font-size: 0.8rem;
    }
    
    .card-code {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .textures-grid {
        gap: 12px;
    }
    
    .card-inner {
        padding-bottom: 150%; /* Taller on mobile */
    }
}
