/* Modern CSS Design System - Google AI Agents Day 1 Codelab */

:root {
    --bg-color: #0b0c10;
    --card-bg: rgba(20, 22, 30, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f5f7fa;
    --text-secondary: #949aab;
    --accent-snow: #4fc3f7;
    --accent-snow-glow: rgba(79, 195, 247, 0.4);
    --accent-balloons: #ff4081;
    --accent-balloons-glow: rgba(255, 64, 129, 0.4);
    
    /* Font Stack */
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background Grids and Glows */
.bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 50px 50px;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    z-index: 1;
}

.bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    filter: blur(80px);
    z-index: 2;
    pointer-events: none;
}

/* Control Card Container */
.app-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 480px;
}

/* Glassmorphic Control Dashboard */
.control-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px 32px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 32px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.control-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Header Section */
.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 32px;
    color: var(--accent-snow);
    animation: rotateLogo 10s linear infinite;
}

.badge {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.card-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Button Group Layout */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Common Button Styling */
.control-btn {
    border: none;
    border-radius: 16px;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    font-family: var(--font-primary);
    color: var(--text-primary);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.btn-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 2px;
}

.btn-title {
    font-size: 16px;
    font-weight: 600;
}

.btn-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
}

/* Snowflakes Button Style */
.btn-snow {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.1) 0%, rgba(79, 195, 247, 0.03) 100%);
    border: 1px solid rgba(79, 195, 247, 0.2);
}

.btn-snow:hover {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.2) 0%, rgba(79, 195, 247, 0.05) 100%);
    border-color: var(--accent-snow);
    box-shadow: 0 0 20px var(--accent-snow-glow);
}

.btn-snow:hover .btn-icon {
    transform: rotate(45deg);
    color: var(--accent-snow);
}

/* Balloons Button Style */
.btn-balloons {
    background: linear-gradient(135deg, rgba(255, 64, 129, 0.1) 0%, rgba(255, 64, 129, 0.03) 100%);
    border: 1px solid rgba(255, 64, 129, 0.2);
}

.btn-balloons:hover {
    background: linear-gradient(135deg, rgba(255, 64, 129, 0.2) 0%, rgba(255, 64, 129, 0.05) 100%);
    border-color: var(--accent-balloons);
    box-shadow: 0 0 20px var(--accent-balloons-glow);
}

.btn-balloons:hover .btn-icon {
    transform: translateY(-4px) scale(1.1);
    color: var(--accent-balloons);
}

/* Active Click Effect */
.control-btn:active {
    transform: scale(0.98);
}

/* Footer Section */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    font-size: 11px;
    color: var(--text-secondary);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px #4caf50;
}

/* Animation Canvas Overlay */
.animation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

/* --- PHYSICS SIMULATION ELEMENTS --- */

/* Snowflakes */
.snowflake {
    position: absolute;
    color: #ffffff;
    font-size: var(--size);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    opacity: var(--opacity);
    top: -20px;
    animation-name: fallAnimation;
    animation-timing-function: linear;
    animation-duration: var(--duration);
    animation-delay: var(--delay);
}

/* Balloons */
.balloon {
    position: absolute;
    width: var(--width);
    height: var(--height);
    background-color: var(--color);
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    opacity: 0.85;
    bottom: -100px;
    animation-name: floatAnimation;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation-duration: var(--duration);
    animation-delay: var(--delay);
    box-shadow: inset -5px -5px 12px rgba(0,0,0,0.15), 0 6px 12px rgba(0,0,0,0.15);
}

/* Balloon string & knot detail */
.balloon::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid var(--color);
}

.balloon-string {
    position: absolute;
    width: 1px;
    height: 60px;
    background: rgba(255, 255, 255, 0.4);
    bottom: -68px;
    left: 50%;
}

/* --- KEYFRAME ANIMATIONS --- */

@keyframes rotateLogo {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Snowflake Fall Physics */
@keyframes fallAnimation {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
    }
    50% {
        transform: translateY(50vh) translateX(var(--drift)) rotate(180deg);
    }
    100% {
        transform: translateY(105vh) translateX(calc(var(--drift) * 2)) rotate(360deg);
    }
}

/* Balloon Float Physics */
@keyframes floatAnimation {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    50% {
        transform: translateY(-50vh) translateX(var(--wobble)) rotate(var(--angle));
    }
    100% {
        transform: translateY(-115vh) translateX(calc(var(--wobble) * -1)) rotate(calc(var(--angle) * -1));
        opacity: 0;
    }
}
