/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 1rem;
}

/* Container - Mobile First */
.container {
    max-width: 600px;
    max-height: 100%;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Header */
header {
    position: relative;
    text-align: center;
    margin-bottom: 1.5rem;
}

header h1 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hamburger {
    display: block;
    width: 24px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* Menu Dropdown */
.menu-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.menu-dropdown.hidden {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.menu-btn {
    padding: 0.75rem 1rem;
    background-color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

/* Progress Section */
.progress-section {
    margin-bottom: 1rem;
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #8BC34A 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Score Section */
.score-section {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
}

.score-item {
    text-align: center;
}

.score-label {
    color: white;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.25rem;
}

.score-value {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Flashcard Container */
.flashcard-container {
    perspective: 1000px;
    margin-bottom: 1.5rem;
}

.flashcard {
    position: relative;
    width: 100%;
    height: 400px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.flashcard-front {
    background-color: white;
}

.flashcard-back {
    background-color: white;
    transform: rotateY(180deg);
}

.card-content {
    text-align: center;
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
}

.flashcard-front .card-content h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.year {
    font-size: 1.5rem;
    color: #666;
}

/* Senator Image */
.senator-image {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 4px solid #667eea;
}

.flashcard-back .card-content h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.party {
    font-size: 1rem;
    color: #666;
    margin-bottom: 1rem;
}

/* Fun Facts */
.fun-facts {
    text-align: left;
    max-width: 100%;
}

.fun-facts h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.fun-facts ul {
    list-style-position: inside;
    padding-left: 0;
}

.fun-facts li {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.action-btn {
    padding: 1rem 2rem;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.action-btn:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
}

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

/* Answer Buttons */
.answer-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.answer-btn {
    flex: 1;
    padding: 0.875rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.incorrect-btn {
    background-color: #ef4444;
    color: white;
}

.incorrect-btn:hover {
    background-color: #dc2626;
}

.incorrect-btn.selected {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.5);
}

.correct-btn {
    background-color: #10b981;
    color: white;
}

.correct-btn:hover {
    background-color: #059669;
}

.correct-btn.selected {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.5);
}

.answer-btn:active {
    transform: scale(0.98);
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    padding: 0.75rem 1.25rem;
    background-color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.nav-btn:hover {
    background-color: #f3f4f6;
    transform: translateY(-2px);
}

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

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.card-position {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

/* Tablet and Desktop */
@media (min-width: 640px) {
    .container {
        padding: 2rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .controls {
        flex-direction: row;
        justify-content: center;
    }

    .control-btn {
        flex: 0 1 auto;
        min-width: 150px;
    }

    .flashcard {
        height: 450px;
    }

    .senator-image {
        width: 180px;
        height: 180px;
    }
}

@media (min-width: 768px) {
    body {
        padding: 2rem;
    }

    .flashcard {
        height: 500px;
    }
}
