/**
 * Tag Cards System CSS
 * 
 * Reusable tag card components with customizable sizes and aspect ratios
 */

/* =============================================================================
   BASE TAG CARD STYLES
   ============================================================================= */

.tag-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    border: 2px solid #333;
    background: #1a1a1a;
    color: #fff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-height: 120px;
    padding: 20px 8px 8px 8px; /* Extra top padding for type label */
}

.tag-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.tag-card.has-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.tag-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* =============================================================================
   SIZE VARIANTS
   ============================================================================= */

/* Small Cards */
.tag-card-small {
    --card-width: 160px;
    --font-size: 14px;
    --padding: 12px;
    --border-width: 1px;
}

.tag-card-small {
    width: var(--card-width);
    padding: 16px 8px 8px 8px; /* Top padding for type label */
    border-width: var(--border-width);
}

/* Medium Cards (Default) */
.tag-card-medium {
    --card-width: 200px;
    --font-size: 16px;
    --padding: 15px;
    --border-width: 2px;
}

.tag-card-medium {
    width: var(--card-width);
    padding: 20px 8px 8px 8px; /* Top padding for type label */
    border-width: var(--border-width);
}

/* Large Cards */
.tag-card-large {
    --card-width: 240px;
    --font-size: 18px;
    --padding: 18px;
    --border-width: 2px;
}

.tag-card-large {
    width: var(--card-width);
    padding: 24px 8px 8px 8px; /* Top padding for type label */
    border-width: var(--border-width);
}

/* =============================================================================
   ASPECT RATIO VARIANTS
   ============================================================================= */

/* Scene Tags - 2:1 Landscape */
.tag-card-scene {
    aspect-ratio: 2 / 1;
    min-height: 100px;
}

/* Performer Tags - 9:16 Vertical */
.tag-card-performer {
    aspect-ratio: 9 / 16;
    min-height: 160px;
}

/* =============================================================================
   TAG CARD CONTENT
   ============================================================================= */

.tag-name {
    font-size: var(--font-size);
    font-weight: 600;
    margin-bottom: 0.5rem;
    z-index: 2;
    position: relative;
    text-align: center;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.tag-count {
    font-size: calc(var(--font-size) * 0.8);
    color: rgba(255, 255, 255, 0.9);
    z-index: 2;
    position: relative;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.tag-type {
    font-size: calc(var(--font-size) * 0.6);
    z-index: 2;
    position: absolute;
    top: 2px;
    left: 4px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* =============================================================================
   TAG TYPE STYLING
   ============================================================================= */

/* Scene Tags - Pink Theme */
.tag-card-scene {
    border-color: #ff33b5;
}

.tag-card-scene:hover {
    border-color: #ff33b5;
    box-shadow: 0 8px 25px rgba(255, 51, 181, 0.3);
}

.tag-card-scene .tag-name {
    text-shadow: 0 0 10px #ff33b5, 0 0 20px #ff33b5, 0 0 30px #ff33b5, 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tag-card-scene .tag-count {
    text-shadow: 0 0 8px #ff33b5, 0 0 16px #ff33b5, 0 1px 3px rgba(0, 0, 0, 0.8);
}

.tag-card-scene .tag-type {
    color: #ff33b5;
    text-shadow: 0 0 8px #ff33b5, 0 0 16px #ff33b5, 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Performer Tags - Blue Theme */
.tag-card-performer {
    border-color: #4fd6ff;
}

.tag-card-performer:hover {
    border-color: #4fd6ff;
    box-shadow: 0 8px 25px rgba(79, 214, 255, 0.3);
}

.tag-card-performer .tag-name {
    text-shadow: 0 0 10px #4fd6ff, 0 0 20px #4fd6ff, 0 0 30px #4fd6ff, 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tag-card-performer .tag-count {
    text-shadow: 0 0 8px #4fd6ff, 0 0 16px #4fd6ff, 0 1px 3px rgba(0, 0, 0, 0.8);
}

.tag-card-performer .tag-type {
    color: #4fd6ff;
    text-shadow: 0 0 8px #4fd6ff, 0 0 16px #4fd6ff, 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* =============================================================================
   GRID LAYOUTS
   ============================================================================= */

.tag-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

/* Scene Tag Grids - Wider columns for landscape cards */
.tag-grid-scene {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.tag-grid-scene.tag-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.tag-grid-scene.tag-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Performer Tag Grids - Wider columns for 9:16 vertical cards */
.tag-grid-performer {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 25px; /* Extra gap to prevent overlap */
}

.tag-grid-performer.tag-grid-small {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.tag-grid-performer.tag-grid-large {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* =============================================================================
   SECTION STYLES
   ============================================================================= */

.tag-section {
    margin: 40px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    text-align: center;
}

.tag-section-small .section-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.tag-section-large .section-title {
    font-size: 2.5rem;
    margin-bottom: 25px;
}

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 768px) {
    .tag-grid {
        gap: 15px;
        margin: 15px 0;
    }
    
    .tag-grid-scene {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .tag-grid-performer {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .tag-card-small {
        --card-width: 120px;
        --font-size: 12px;
        --padding: 8px;
    }
    
    .tag-card-medium {
        --card-width: 150px;
        --font-size: 14px;
        --padding: 12px;
    }
    
    .tag-card-large {
        --card-width: 180px;
        --font-size: 16px;
        --padding: 15px;
    }
}

@media (max-width: 480px) {
    .tag-grid {
        gap: 10px;
        margin: 10px 0;
    }
    
    .tag-grid-scene {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .tag-grid-performer {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .section-title {
        font-size: 1.25rem;
    }
}
