/* Container Queries V2 - LEGO Sets Demo */
@import url('shared.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background: #f5f5f0;
    min-height: 100vh;
    color: #1a1a1a;
    position: relative;
}

/* Subtle background glows */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 600px 400px at 10% 20%, rgba(134, 239, 172, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 500px 350px at 85% 80%, rgba(253, 224, 71, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 400px 300px at 50% 50%, rgba(251, 207, 232, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

header {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 2rem 1rem;
    position: relative;
    z-index: 1;
}

.back-link {
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    max-width: 500px;
}

/* Main Content */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem 2rem;
    position: relative;
    z-index: 1;
}

.demo-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.demo-section > p {
    color: #666;
    margin-bottom: 2rem;
}

/* Demo Rows */
.demo-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.demo-row.align-right {
    justify-content: flex-end;
}

/* Resizable Container Wrapper */
.resizable {
    resize: horizontal;
    overflow: hidden;
    min-width: 200px;
    max-width: 100%;
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    padding: 1rem;
    background: #fff;
    position: relative;
    transition: box-shadow 0.2s ease;
}

.resizable:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.resizable::after {
    content: '⋮⋮';
    position: absolute;
    bottom: 4px;
    right: 8px;
    font-size: 0.75rem;
    color: #ccc;
    pointer-events: none;
}

.resizable.wide {
    max-width: 700px;
}

/* Container Query Context */
.container {
    container-type: inline-size;
    container-name: card;
}

/* LEGO Card Base Styles */
.lego-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lego-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.set-image {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.lego-card:hover .set-image {
    transform: scale(1.02);
}

.set-emoji {
    font-size: 4rem;
    transition: transform 0.3s ease;
}

.lego-card:hover .set-emoji {
    transform: scale(1.1) rotate(-5deg);
    animation: wiggle 0.5s ease;
}

@keyframes wiggle {
    0%, 100% { transform: scale(1.1) rotate(-5deg); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.set-info {
    padding: 1rem;
}

.theme {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: #E30613;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 100px;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease;
}

.lego-card:hover .theme {
    transform: translateX(2px);
}

.set-info h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.description {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    display: none;
}

.stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.stat {
    text-align: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.stat:hover {
    transform: scale(1.05);
    color: #E30613;
}

.stat-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-label {
    display: block;
    font-size: 0.65rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn {
    width: 100%;
    padding: 0.6rem 1rem;
    background: #E30613;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Container Query Breakpoints */

/* Medium: 280px+ - Show description */
@container card (min-width: 280px) {
    .description {
        display: block;
    }
}

/* Large: 360px+ - Horizontal layout */
@container card (min-width: 360px) {
    .lego-card {
        display: flex;
        align-items: stretch;
    }
    
    .set-image {
        width: 140px;
        min-width: 140px;
        height: auto;
        min-height: 180px;
    }
    
    .set-emoji {
        font-size: 4rem;
    }
    
    .set-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .stats {
        gap: 1.5rem;
    }
}

/* XL: 500px+ - Larger everything */
@container card (min-width: 500px) {
    .set-image {
        width: 200px;
        min-width: 200px;
    }
    
    .set-emoji {
        font-size: 5rem;
    }
    
    .set-info h3 {
        font-size: 1.25rem;
    }
    
    .description {
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    color: #999;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

/* Responsive */
@media (max-width: 768px) {
    header, main {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .demo-row {
        flex-direction: column;
    }
    
    .resizable {
        width: 100% !important;
        max-width: 100%;
    }
}
