/* Room Card Viewer - Custom Styles */
/* Version: 2.0.0 - Room Analytics */

/* Card animations */
#roomDetails .card-base {
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Analytics Section */
#roomAnalyticsSection {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chart card styling */
#roomAnalyticsSection .card-base {
    transition: all 0.3s ease;
}

#roomAnalyticsSection .card-base:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Stats cards animation */
#analyticsOverview > div {
    animation: scaleIn 0.4s ease-out;
    animation-fill-mode: both;
}

#analyticsOverview > div:nth-child(1) { animation-delay: 0.1s; }
#analyticsOverview > div:nth-child(2) { animation-delay: 0.15s; }
#analyticsOverview > div:nth-child(3) { animation-delay: 0.2s; }
#analyticsOverview > div:nth-child(4) { animation-delay: 0.25s; }

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Quick stats cards */
.grid > .card-base[style*="border-color"] {
    transition: all 0.3s ease;
}

.grid > .card-base[style*="border-color"]:hover {
    transform: scale(1.02);
}

/* Period button transitions */
.period-btn {
    transition: all 0.2s ease;
}

.period-btn:hover:not(.active) {
    background: rgba(100, 108, 255, 0.1);
    border-color: rgba(100, 108, 255, 0.3);
}

/* Room badges styling */
.flex-wrap > span[class*="rounded"] {
    transition: all 0.2s ease;
}

.flex-wrap > span[class*="rounded"]:hover {
    transform: scale(1.05);
}

/* Room Products Section */
#roomProductsSection {
    animation: fadeInUp 0.5s ease-out;
    animation-delay: 0.3s;
    animation-fill-mode: both;
}

/* Product Cards Grid */
#roomProductsGrid {
    gap: 16px;
}

/* Product Card Styling */
.product-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(100, 108, 255, 0.3);
}

/* Product Image Container */
.product-card .aspect-square {
    position: relative;
    overflow: hidden;
}

.product-card .aspect-square::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

/* Product Card Animation */
.product-card {
    animation: productCardAppear 0.4s ease-out;
    animation-fill-mode: both;
}

@keyframes productCardAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Stagger animation for product cards */
.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(9) { animation-delay: 0.45s; }
.product-card:nth-child(10) { animation-delay: 0.5s; }

/* Hidden products banner */
#roomProductsGrid > .col-span-full {
    animation: none;
}

/* Section Toggle Buttons */
#toggleAnalyticsBtn,
#toggleProductsBtn {
    cursor: pointer;
    backdrop-filter: blur(4px);
}

#toggleAnalyticsBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(100, 108, 255, 0.3);
}

#toggleProductsBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(167, 139, 250, 0.3);
}

/* Smooth section transitions */
#roomAnalyticsSection,
#roomProductsSection {
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

#roomAnalyticsSection:not(.hidden),
#roomProductsSection:not(.hidden) {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Analytics stats grid - 2x2 */
    #analyticsOverview {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    /* Chart containers */
    .chart-container {
        height: 200px !important;
    }
    
    /* Products grid - 2 columns */
    #roomProductsGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .product-card {
        padding: 8px !important;
    }
    
    /* Room info cards */
    #roomDetails .card-base {
        padding: 12px !important;
    }
    
    /* Period buttons - wrap */
    .flex.gap-2.flex-wrap {
        gap: 6px !important;
    }
    
    .period-btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
    /* Toggle buttons */
    #toggleAnalyticsBtn,
    #toggleProductsBtn {
        width: 100% !important;
        justify-content: center !important;
    }
}

@media (max-width: 480px) {
    #analyticsOverview {
        grid-template-columns: 1fr !important;
    }
    
    #roomProductsGrid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .chart-container {
        height: 180px !important;
    }
}

