/* TCC Gig Guide Styles */

.tcc-gig-guide {
    width: calc(100vw - (100vw - 100%));
    margin-left: calc(50% - 50vw + (100vw - 100%) / 2);
    margin-right: calc(50% - 50vw + (100vw - 100%) / 2);
    padding: 20px 0;
    box-sizing: border-box;
}

/* Inner container for proper padding without causing overflow */
.tcc-gig-guide > * {
    padding-left: 1em;
    padding-right: 1em;
    max-width: 100%;
    box-sizing: border-box;
}

/* Filter Buttons */
.tcc-gig-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-start;
}

/* Filter Groups */
.tcc-filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tcc-filter-group:not(:last-child)::after {
    content: '|';
    color: #ccc;
    margin-left: 10px;
    font-weight: 300;
}

/* Default filter button (Show All) */
.tcc-filter-btn {
    background: #333;
    color: #fff;
    border: 2px solid #333;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tcc-filter-btn:hover {
    background: #555;
    border-color: #555;
}

.tcc-filter-btn.active {
    background: #fff;
    color: #333;
    border-color: #333;
}

/* Flick's filter button - Teal */
.tcc-filter-btn[data-filter="venue-flicks"] {
    background: #14b8a6; /* Teal */
    color: #fff;
    border-color: #14b8a6;
}

.tcc-filter-btn[data-filter="venue-flicks"]:hover {
    background: #0d9488; /* Darker teal */
    border-color: #0d9488;
}

.tcc-filter-btn[data-filter="venue-flicks"].active {
    background: #fff;
    color: #14b8a6;
    border-color: #14b8a6;
}

/* Sweethearts filter button - Dark Brown */
.tcc-filter-btn[data-filter="venue-sweethearts"] {
    background: #78350f; /* Dark brown */
    color: #fff;
    border-color: #78350f;
}

.tcc-filter-btn[data-filter="venue-sweethearts"]:hover {
    background: #5c290b; /* Darker brown */
    border-color: #5c290b;
}

.tcc-filter-btn[data-filter="venue-sweethearts"].active {
    background: #fff;
    color: #78350f;
    border-color: #78350f;
}

/* View Toggle Buttons */
.tcc-view-btn {
    background: #666;
    color: #fff;
    border: 2px solid #666;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tcc-view-btn:hover {
    background: #777;
    border-color: #777;
}

.tcc-view-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Grid Layout */
.tcc-gig-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
    grid-auto-rows: 1fr; /* Make all rows the same height */
}

/* Individual Card */
.tcc-gig-card {
    background: transparent;
    border-radius: 8px;
    transition: transform 0.3s ease;
    /* GSAP handles opacity and transform animations */
    perspective: 1000px; /* Enable 3D perspective for flip effect */
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Flip Container */
.tcc-card-flip-container {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
    transform-style: preserve-3d;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Flipped State */
.tcc-gig-card.flipped .tcc-card-flip-container {
    transform: rotateY(180deg);
}

/* Card Sides (Front and Back) */
.tcc-card-front,
.tcc-card-back {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Ensure proper clipping of child elements */
    isolation: isolate;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Back side is initially rotated */
.tcc-card-back {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    height: 100%; /* Take full height of container */
}

/* Hover effects for card fronts only */
.tcc-gig-card:not(.flipped):hover .tcc-card-front {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Featured Image - 1:1 Aspect Ratio */
.tcc-card-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Creates 1:1 aspect ratio */
    position: relative;
    /* Prevent sub-pixel rendering gaps */
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    /* Ensure complete image coverage */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    overflow: hidden;
}

/* Actual img element styling */
.tcc-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    transition: all 0.3s ease;
}

/* WebP images are now handled entirely by JavaScript dual-image system */

.tcc-card-no-image {
    background-color: #f5f5f5;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTM1IDVINUMzLjMgNSAyIDYuMyAyIDhWMzJDMiAzMy43IDMuMyAzNSA1IDM1SDM1QzM2LjcgMzUgMzggMzMuNyAzOCAzMlY4QzM4IDYuMyAzNi43IDUgMzUgNVpNMzUgMzJINUw4LjUgMjhMMTMuNSAzM0wyMSAyNS41TDM1IDMyWiIgZmlsbD0iI2NjYyIvPgo8Y2lyY2xlIGN4PSIxNCIgY3k9IjE0IiByPSIzIiBmaWxsPSIjY2NjIi8+Cjwvc3ZnPgo=');
    background-position: center;
    background-size: 40px 40px;
}

/* Venue Label Overlay */
.tcc-venue-label {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

/* Default venue label styling */
.tcc-venue-label {
    background: rgba(0, 0, 0, 0.7);
}

/* Flick's venue label - Teal color */
.venue-flicks .tcc-venue-label {
    background: rgba(20, 184, 166, 0.9); /* Teal-500 with opacity */
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.9), rgba(13, 148, 136, 0.9));
}

/* Sweethearts venue label - Dark brown color */
.venue-sweethearts .tcc-venue-label {
    background: rgba(120, 53, 15, 0.9); /* Dark brown with opacity */
    background: linear-gradient(135deg, rgba(120, 53, 15, 0.9), rgba(92, 41, 11, 0.9));
}

/* Multi-venue label - Teal to Dark Brown gradient */
.venue-flicks.venue-sweethearts .tcc-venue-label {
    background: linear-gradient(135deg, #14b8a6 0%, #78350f 100%);
}

/* Card Content */
.tcc-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Grid view specific styles */
.tcc-gig-guide:not(.list-view) .tcc-card-header {
    display: block; /* Stack vertically in grid view */
}

.tcc-gig-guide:not(.list-view) .tcc-card-meta {
    display: block; /* Stack vertically in grid view */
    margin-top: 12px;
}

.tcc-gig-guide:not(.list-view) .tcc-card-list-content {
    display: none; /* Hide content in grid view, use flip instead */
}

.tcc-card-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.tcc-card-date {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 600;
    position: relative; /* For absolute positioning of icon */
    padding-right: 40px; /* Space for the icon */
}

/* Info Icon Styling - Mobile Touch Friendly & Absolutely Positioned */
.tcc-info-icon {
    color: #666; /* Default gray for cards without venue */
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    padding: 2px; /* Smaller padding since icon has built-in circle */
    min-width: 32px; /* Minimum touch target */
    min-height: 32px;
    justify-content: center;
    /* Absolute positioning to not affect card height */
    position: absolute;
    top: -2px; /* Slight adjustment for better visual alignment */
    right: 0;
}

.tcc-info-icon:hover {
    transform: scale(1.1);
}

.tcc-info-icon svg {
    width: 24px; /* Perfect size for the filled icon */
    height: 24px;
}

/* Venue-specific info icon colors */
.venue-flicks .tcc-info-icon {
    color: #14b8a6; /* Teal */
}

.venue-flicks .tcc-info-icon:hover {
    color: #0d9488; /* Darker teal on hover */
}

.venue-sweethearts .tcc-info-icon {
    color: #78350f; /* Dark brown */
}

.venue-sweethearts .tcc-info-icon:hover {
    color: #5c290b; /* Darker brown on hover */
}

.tcc-card-time {
    font-size: 15px;
    color: #888;
    margin-top: 8px;
}

.tcc-start-time,
.tcc-end-time {
    font-weight: 500;
}

/* Read More Button */
.tcc-read-more-btn {
    background: #333;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.tcc-read-more-btn:hover {
    background: #555;
}

/* Back Side Content - Fixed Padding */
.tcc-card-back-content {
    padding: 0; /* Remove double padding */
    flex: 1;
    overflow-y: auto;
}

.tcc-card-back-header {
    padding: 20px 20px 15px 20px; /* Consistent top/side padding */
    margin-bottom: 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.tcc-card-back-title {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    line-height: 1.3;
}

.tcc-card-back-date {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-weight: 600;
}

.tcc-card-back-body {
    color: #333; /* Darker text for better readability */
    line-height: 1.6;
    font-size: 14px;
}

.tcc-card-back-body p {
    margin: 0 0 15px 0;
    color: #333; /* Force black text */
}

.tcc-card-back-body p:last-child {
    margin-bottom: 0;
}

/* Force all back side content to have proper colors */
.tcc-card-back * {
    color: #333;
}

.tcc-card-back h1, 
.tcc-card-back h2, 
.tcc-card-back h3, 
.tcc-card-back h4, 
.tcc-card-back h5, 
.tcc-card-back h6 {
    color: #222;
    margin-top: 0;
    margin-bottom: 10px;
}

.tcc-card-back a {
    color: #0073aa;
    text-decoration: underline;
}

.tcc-card-back a:hover {
    color: #005a87;
}

/* Back Button - Icon Only with Venue Colors */
.tcc-back-btn {
    background: #666; /* Default gray */
    color: #fff;
    border: none;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; /* Fixed width */
    height: 32px; /* Fixed height */
    min-width: 32px;
    min-height: 32px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.tcc-back-btn:hover {
    background: #555;
    transform: scale(1.1);
}

.tcc-back-btn svg {
    width: 16px;
    height: 16px;
    color: #fff !important; /* Ensure SVG stays white */
    flex-shrink: 0; /* Prevent SVG from shrinking */
    display: block; /* Remove any inline spacing */
    margin: 0 auto; /* Center the SVG */
}

.tcc-back-btn svg * {
    color: #fff !important; /* Ensure all SVG paths stay white */
    stroke: currentColor;
    fill: none; /* Ensure paths don't get filled unexpectedly */
}

/* Venue-specific back button colors */
.venue-flicks .tcc-back-btn {
    background: #14b8a6; /* Teal */
}

.venue-flicks .tcc-back-btn:hover {
    background: #0d9488; /* Darker teal */
}

.venue-sweethearts .tcc-back-btn {
    background: #78350f; /* Dark brown */
}

.venue-sweethearts .tcc-back-btn:hover {
    background: #5c290b; /* Darker brown */
}

/* Back side footer styling */
.tcc-card-back-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
    font-size: 12px;
    color: #666;
}

/* List View Styles */
.tcc-gig-guide.list-view .tcc-gig-grid {
    display: block;
    gap: 0;
}

.tcc-gig-guide.list-view .tcc-gig-card {
    display: flex;
    align-items: flex-start;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    padding: 20px;
    transition: none !important; /* Remove all transitions */
    perspective: none;
    height: auto;
}

.tcc-gig-guide.list-view .tcc-gig-card:hover {
    /* Explicitly disable all hover effects */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transform: none !important;
    background: #fff !important;
}

.tcc-gig-guide.list-view .tcc-card-flip-container {
    display: flex;
    align-items: flex-start;
    width: 100%;
    transform: none;
    transform-style: flat;
}

.tcc-gig-guide.list-view .tcc-card-front {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    transition: none !important; /* Remove transitions */
}

/* Override the card front hover effect specifically in list view */
.tcc-gig-guide.list-view .tcc-gig-card:hover .tcc-card-front {
    box-shadow: none !important;
    transform: none !important;
    background: transparent !important;
}

/* Also override any content hover effects */
.tcc-gig-guide.list-view .tcc-card-content:hover {
    transform: none !important;
    box-shadow: none !important;
}

.tcc-gig-guide.list-view .tcc-card-back {
    display: none; /* Hide flip functionality in list view */
}

.tcc-gig-guide.list-view .tcc-card-image {
    display: none; /* Hide images in list view */
}

.tcc-gig-guide.list-view .tcc-card-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    gap: 12px;
}

/* Header row with title, date, and time */
.tcc-gig-guide.list-view .tcc-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.tcc-gig-guide.list-view .tcc-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.tcc-gig-guide.list-view .tcc-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Venue label in list view - styled as a small tag */
.tcc-gig-guide.list-view .tcc-venue-label-list {
    background: #666;
    color: #fff;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* Venue-specific colors for list view venue label - using individual label classes */
.tcc-gig-guide.list-view .tcc-venue-label-list.tcc-flicks-label {
    background: #14b8a6 !important; /* Teal */
}

.tcc-gig-guide.list-view .tcc-venue-label-list.tcc-sweethearts-label {
    background: #78350f !important; /* Dark brown */
}

/* Fallback: venue-specific colors for list view venue label using card classes */
.tcc-gig-guide.list-view .venue-flicks .tcc-venue-label-list {
    background: #14b8a6; /* Teal */
}

.tcc-gig-guide.list-view .venue-sweethearts .tcc-venue-label-list {
    background: #78350f; /* Dark brown */
}

.tcc-gig-guide.list-view .tcc-card-date {
    margin: 0;
    padding-right: 0;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.tcc-gig-guide.list-view .tcc-card-time {
    margin: 0;
    font-size: 14px;
    color: #888;
    white-space: nowrap;
}

/* Content area */
.tcc-gig-guide.list-view .tcc-card-list-content {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.tcc-gig-guide.list-view .tcc-card-list-content p {
    margin: 0 0 10px 0;
}

.tcc-gig-guide.list-view .tcc-card-list-content p:last-child {
    margin-bottom: 0;
}

/* Hide info icons in list view */
.tcc-gig-guide.list-view .tcc-info-icon {
    display: none;
}

/* Venue indicators in list view */
.tcc-gig-guide.list-view .tcc-gig-card::before {
    content: '';
    width: 4px;
    height: 100%;
    background: #ddd;
    border-radius: 2px;
    margin-right: 15px;
    flex-shrink: 0;
    align-self: stretch;
}

.tcc-gig-guide.list-view .tcc-gig-card.venue-flicks::before {
    background: #14b8a6; /* Teal */
}

.tcc-gig-guide.list-view .tcc-gig-card.venue-sweethearts::before {
    background: #78350f; /* Dark brown */
}

/* Hidden cards for filtering */
.tcc-gig-card.hidden {
    display: none;
}

/* GSAP-compatible animation states - minimal CSS needed */
.tcc-card-loading {
    opacity: 0;
}


/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .tcc-gig-card,
    .tcc-card-animate-in,
    .tcc-card-filtering {
        animation: none;
        transition: opacity 0.2s ease;
        transform: none !important;
    }
    
    .tcc-gig-card:hover {
        transform: none;
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    }
}

/* Performance optimizations */
.tcc-gig-grid {
    /* Enable hardware acceleration for smoother animations */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Focus states for accessibility */
.tcc-filter-btn:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

.tcc-gig-card:focus-within {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tcc-gig-guide {
        padding: 15px;
    }
    
    .tcc-gig-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .tcc-gig-filters {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .tcc-filter-group {
        justify-content: center;
        width: 100%;
        max-width: 420px;
        gap: 8px;
        flex-wrap: nowrap; /* Prevent wrapping within groups */
    }
    
    .tcc-filter-group::after {
        display: none; /* Hide separators on mobile */
    }
    
    .tcc-filter-btn {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .tcc-view-btn {
        padding: 8px 16px;
        font-size: 14px;
        flex: 1;
        min-width: 0;
        text-align: center;
    }
    
    .tcc-card-content {
        padding: 15px;
    }
    
    .tcc-card-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .tcc-gig-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tcc-gig-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .tcc-filter-group {
        max-width: 100%;
        gap: 6px;
    }
    
    .tcc-filter-btn {
        padding: 8px 10px;
        font-size: 12px;
        flex: 1;
        min-width: 0;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .tcc-view-btn {
        padding: 8px 14px;
        font-size: 13px;
        flex: 1;
        min-width: 0;
        text-align: center;
    }
}

/* Loading state (optional) */
.tcc-gig-guide.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Venue-specific styling (optional) */
.tcc-gig-card.venue-flicks {
    /* You can add venue-specific styling here if needed */
}

.tcc-gig-card.venue-sweethearts {
    /* You can add venue-specific styling here if needed */
}

/* Debug Styles */
.tcc-debug {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    font-family: monospace;
    font-size: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.tcc-debug h4 {
    color: #495057;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
}

.tcc-debug pre {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    padding: 10px;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}
