:root {
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Brand Colors */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-white: #ffffff;
    --bg-body: #f0f4f8;
    --card-bg: #ffffff;

    /* Situation Specific Gradients */
    --grad-morning: linear-gradient(135deg, #FF9966 0%, #FF5E62 100%);
    --grad-evening: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --grad-casual: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    --grad-formal: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
    --grad-friends: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --grad-goodbye: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-colored: 0 10px 25px -5px rgba(0, 0, 0, 0.15);

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Video Background */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

#bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.1);
    /* Minimal dark tint for contrast */
    pointer-events: none;
}

/* Header */
.app-header {
    text-align: center;
    padding: 2rem;
    margin: 1.5rem auto;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo-emoji {
    font-size: 2.5rem;
    animation: wave 2s infinite ease-in-out;
    display: inline-block;
    transform-origin: 70% 70%;
}

h1 {
    font-weight: 800;
    font-size: 2.25rem;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
}

/* Main Container */
#app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    flex: 1;
}

/* Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    perspective: 1000px;
}

/* Situation Card */
.situation-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.situation-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl), var(--shadow-colored);
}

.situation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--card-gradient);
}

.card-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.situation-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.card-desc {
    font-size: 0.95rem;
    color: var(--text-light);
}

/* Detail View */
.hidden {
    display: none;
}

#detail-view {
    animation: fadeIn 0.4s ease;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(-5px);
    color: var(--primary);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

#situation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.detail-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 0.5rem;
}

.detail-title {
    font-size: 2.5rem;
    font-weight: 800;
}

/* Cultural Tip */
.tip-card {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 5px solid #FFD700;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.tip-card::before {
    content: '💡';
    font-size: 1.5rem;
}

.tip-content strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.tip-content p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Phrases List */
.phrases-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.phrase-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

.phrase-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.phrase-card.playing {
    border-color: #10b981;
    background-color: #ecfdf5;
}

.phrase-content {
    flex: 1;
}

.phrase-row {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.spanish-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.tone-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 600;
}

.english-meaning {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 1rem;
}

.audio-btn {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.audio-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
    border-color: var(--primary);
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    margin-top: auto;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Animations */
@keyframes wave {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(14deg);
    }

    20% {
        transform: rotate(-8deg);
    }

    30% {
        transform: rotate(14deg);
    }

    40% {
        transform: rotate(-4deg);
    }

    50% {
        transform: rotate(10deg);
    }

    60% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 1.8rem;
    }

    .phrase-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .audio-btn {
        align-self: flex-end;
        margin-left: 0;
        margin-top: -3rem;
        /* Hacky absolute hack or just let it adjust? 
           Better to just let it flow or use grid. 
           Let's keep it clean. */
        margin-top: 0;
    }

    .phrase-card {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 1rem;
        align-items: center;
    }

    .audio-btn {
        margin: 0;
    }
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    #app-container {
        padding: 1rem;
    }

    .grid-container {
        gap: 1rem;
    }
}