:root {
    --primary-color: #4a90e2;
    --secondary-color: #50e3c2;
    --accent-color: #ff5b5b;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --card-bg: #fff;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

h1,
h2,
h3 {
    text-align: center;
    color: #2c3e50;
}

/* Header & Nav */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: white;
    margin: 0;
    font-size: 2.5rem;
}

nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

nav button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

nav button:hover,
nav button.active {
    background: white;
    color: #764ba2;
    transform: translateY(-2px);
}

/* Main Container */
#app-container {
    width: 90%;
    max-width: 1000px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    min-height: 500px;
}

.view-section {
    display: none;
    animation: fadeIn 0.5s;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards (Learn View) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.theory-card {
    background: var(--bg-color);
    border-radius: 10px;
    cursor: pointer;
    perspective: 1000px;
    height: 300px;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.theory-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 10px;
}

.card-front {
    background-color: #fff;
    color: #333;
    border: 2px solid #e0e0e0;
}

.card-front h3 {
    font-size: 1.5rem;
    color: #764ba2;
    margin-bottom: 10px;
}

.card-back {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
    transform: rotateY(180deg);
    text-align: left;
    align-items: flex-start;
}

.card-back ul {
    font-size: 0.9rem;
    padding-left: 20px;
    line-height: 1.4;
}

.hint-text {
    font-size: 0.8rem;
    color: #888;
    margin-top: 15px;
}

/* Game Areas */
.game-container {
    text-align: center;
    padding: 20px;
}

/* Drag and Drop */
#drop-zones {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.drop-zone {
    width: 150px;
    height: 150px;
    border: 3px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #777;
    transition: all 0.3s;
    background: #fafafa;
}

.drop-zone.drag-over {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: scale(1.05);
}

#draggable-container {
    margin-bottom: 30px;
    min-height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.draggable-item {
    background: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: grab;
    font-weight: bold;
    background: #ffecd2;
    border: 2px solid #ff9a9e;
    user-select: none;
}

.draggable-item:active {
    cursor: grabbing;
}

/* Quiz */
.quiz-question {
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.option-btn {
    padding: 15px;
    border: 2px solid #eee;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    text-align: left;
}

.option-btn:hover {
    background: #f9f9f9;
    border-color: #ccc;
}

.option-btn.correct {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.option-btn.wrong {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.explanation {
    margin-top: 20px;
    padding: 15px;
    background-color: #e2e3e5;
    border-radius: 8px;
    display: none;
}

#next-question-btn {
    margin-top: 20px;
    padding: 10px 25px;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

#score-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: #764ba2;
    margin-top: 20px;
}

/* Scenario Game */
.scenario-box {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.choices-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.choice-card {
    flex: 1;
    min-width: 250px;
    background: white;
    border: 2px solid #dedede;
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s;
}

.choice-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
}

/* SMS Game */
.phone-screen {
    max-width: 400px;
    margin: 0 auto;
    border: 10px solid #333;
    border-radius: 30px;
    padding: 20px;
    background: #f9f9f9;
    /* Phone bg */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.chat-bubble {
    background: #e5e5ea;
    padding: 15px;
    border-radius: 20px;
    margin-bottom: 20px;
    position: relative;
    text-align: left;
}

.chat-bubble.received:after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-right-color: #e5e5ea;
    border-left: 0;
    border-top: 0;
    margin-top: -7.5px;
    margin-left: -15px;
}

.sms-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sms-opt-btn {
    padding: 12px;
    border: none;
    background: #007aff;
    /* iMessage blue ish */
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.sms-opt-btn:hover {
    background: #0056b3;
}

.sms-opt-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.minigame-btn {
    border: 1px solid #ccc;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    margin: 0 5px;
    transition: all 0.2s;
}

.minigame-btn:hover {
    background: #e3f2fd;
}