/* Root variables for the premium design system */
:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #111124;
    --glass-bg: rgba(21, 21, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    
    --color-pink: #ff2a74;
    --color-purple: #7b2cbf;
    --color-blue: #00e5ff;
    --color-green: #10b981;
    --color-yellow: #f59e0b;
    --color-red: #ef4444;
    
    --color-pink-glow: rgba(255, 42, 116, 0.3);
    --color-blue-glow: rgba(0, 229, 255, 0.3);
    --color-purple-glow: rgba(123, 44, 191, 0.3);
    
    --font-header: 'Space Grotesk', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-purple);
}

/* Premium Background Glows */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    pointer-events: none;
    z-index: -2;
    opacity: 0.4;
    animation: pulse 12s infinite alternate;
}
.bg-glow-1 {
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, var(--color-pink-glow) 0%, transparent 70%);
}
.bg-glow-2 {
    bottom: -150px;
    left: -150px;
    background: radial-gradient(circle, var(--color-blue-glow) 0%, transparent 70%);
    animation-delay: 6s;
}
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -1;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(30px, 30px); }
}

/* Layout Elements */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Glassmorphism Panel Base Class */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Typography helper classes */
.highlight {
    color: var(--color-pink);
    text-shadow: 0 0 10px var(--color-pink-glow);
}
.gradient-text {
    background: linear-gradient(135deg, var(--color-pink) 0%, var(--color-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-pink { color: var(--color-pink); }
.text-blue { color: var(--color-blue); }
.text-purple { color: var(--color-purple); }
.text-green { color: var(--color-green); }
.text-yellow { color: var(--color-yellow); }

/* Header & Navigation */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--glass-border);
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-header);
    font-size: 24px;
    font-weight: 800;
}
.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px var(--color-pink));
}
.app-nav {
    display: flex;
    gap: 8px;
}
.nav-link {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 15px;
    transition: var(--transition-smooth);
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}
.nav-link.active {
    color: var(--text-primary);
    background: rgba(123, 44, 191, 0.2);
    border-color: rgba(123, 44, 191, 0.4);
    box-shadow: 0 0 15px rgba(123, 44, 191, 0.25);
}

/* Main Content Views */
.app-content {
    flex-grow: 1;
    padding: 40px 0;
}
.view-section {
    display: none;
    animation: fadeIn 0.4s ease-in-out forwards;
}
.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dashboard Style */
.hero-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px auto;
}
.hero-section h1 {
    font-family: var(--font-header);
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
}
.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.stat-card {
    display: flex;
    align-items: center;
    padding: 24px;
    gap: 20px;
}
.stat-icon {
    font-size: 36px;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.05);
}
.stat-details {
    display: flex;
    flex-direction: column;
}
.stat-value {
    font-family: var(--font-header);
    font-size: 28px;
    font-weight: 700;
}
.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}
.dashboard-main, .dashboard-sidebar {
    padding: 30px;
}
.dashboard-main h2, .dashboard-sidebar h2 {
    font-family: var(--font-header);
    font-size: 22px;
    margin-bottom: 24px;
}

.rec-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.rec-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    gap: 20px;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.rec-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-purple);
    transform: translateX(5px);
}
.rec-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.04);
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rec-info {
    flex-grow: 1;
}
.rec-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}
.rec-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.continent-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.bar-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bar-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}
.bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}
.bar-fill {
    height: 100%;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* Button UI */
.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
}
.btn-primary {
    background: linear-gradient(135deg, var(--color-pink) 0%, var(--color-purple) 100%);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(255, 42, 116, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 42, 116, 0.5);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}
.btn-success {
    background: var(--color-green);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}
.btn-danger {
    background: var(--color-red);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.btn-large {
    padding: 14px 32px;
    font-size: 16px;
    border-radius: 12px;
}
.w-full { width: 100%; }

/* Library Explorer Styling */
.section-header {
    margin-bottom: 30px;
}
.section-header h2 {
    font-family: var(--font-header);
    font-size: 28px;
    font-weight: 700;
}
.section-header p {
    color: var(--text-secondary);
}

.search-filters-bar {
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.search-box {
    position: relative;
    width: 100%;
}
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-secondary);
}
.search-box input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    transition: var(--transition-smooth);
}
.search-box input:focus {
    outline: none;
    border-color: var(--color-purple);
    box-shadow: 0 0 10px rgba(123, 44, 191, 0.3);
    background: rgba(0, 0, 0, 0.4);
}
.clear-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    display: none;
}
.clear-btn:hover {
    color: var(--text-primary);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.filter-group label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}
.filter-group select {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.filter-group select:focus {
    border-color: var(--color-purple);
}

.results-summary {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding-left: 5px;
}

/* Library Cards Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.country-card {
    padding: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}
.card-content-wrapper {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.country-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-pink) 0%, var(--color-purple) 100%);
    opacity: 0.6;
}
.country-card:hover {
    transform: translateY(-5px);
    border-color: rgba(123, 44, 191, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 0 0 15px rgba(123, 44, 191, 0.15);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}
.card-flag {
    font-size: 24px;
    display: flex;
    align-items: center;
}
.card-flag-img {
    width: 36px;
    height: auto;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.card-title h3 {
    font-family: var(--font-header);
    font-size: 18px;
    font-weight: 700;
}
.card-title p {
    font-size: 12px;
    color: var(--text-secondary);
}
.badge-tld {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
}
.card-meta-row {
    display: flex;
    gap: 12px;
    font-size: 13px;
    margin-bottom: 14px;
    color: var(--text-secondary);
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-preview-clues {
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.preview-clue {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}
.preview-clue strong {
    color: var(--text-primary);
}

/* Flashcards View Styling */
.flashcards-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
}
.flashcards-sidebar {
    padding: 24px;
    height: fit-content;
}
.flashcards-sidebar h3 {
    font-family: var(--font-header);
    font-size: 18px;
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group select {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    cursor: pointer;
}
.fc-stats {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.fc-stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}
.fc-stat-val {
    font-weight: 700;
}

.flashcards-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.card-progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}
.card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-blue), var(--color-purple));
    box-shadow: 0 0 10px var(--color-blue-glow);
    transition: width 0.4s ease;
}

/* 3D Flashcard Flipping Engine */
.fc-card-wrapper {
    perspective: 1200px;
    width: 100%;
    height: 400px;
}
.fc-card {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.fc-card.flipped {
    transform: rotateY(180deg);
}
.fc-card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.fc-card-front {
    z-index: 2;
    transform: rotateY(0deg);
}
.fc-card-back {
    transform: rotateY(180deg);
    border-color: rgba(123, 44, 191, 0.3);
    background: radial-gradient(circle at center, rgba(123, 44, 191, 0.05) 0%, rgba(21, 21, 42, 0.75) 100%);
}
.card-face-type {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}
.card-action-hint {
    position: absolute;
    bottom: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Clue layout in card */
.fc-clue-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
    width: 100%;
}
.fc-clue-item {
    font-size: 18px;
    color: var(--text-primary);
}
.fc-clue-item strong {
    color: var(--color-blue);
    font-weight: 600;
}
.fc-answer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}
.fc-ans-flag {
    font-size: 72px;
    line-height: 1;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
    display: flex;
    justify-content: center;
    align-items: center;
}
.fc-ans-flag-img {
    width: 120px;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.fc-ans-title {
    font-family: var(--font-header);
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 4px;
}
.fc-ans-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
}
.fc-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}
.fc-controls .btn {
    flex-grow: 1;
    padding: 14px 20px;
}

/* Quiz Screen Styling */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.quiz-screen {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}
.quiz-screen.active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Start screen */
.quiz-intro {
    text-align: center;
}
.quiz-big-icon {
    font-size: 72px;
    margin-bottom: 20px;
}
.quiz-intro h3 {
    font-family: var(--font-header);
    font-size: 24px;
    margin-bottom: 12px;
}
.quiz-intro p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 30px auto;
}
.quiz-settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    text-align: left;
    max-width: 500px;
    margin: 0 auto 30px auto;
}

/* Gameplay Screen */
.quiz-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.quiz-question-box {
    margin: 30px 0;
    text-align: center;
}
.quiz-question-text {
    font-size: 22px;
    font-family: var(--font-header);
    line-height: 1.4;
    font-weight: 500;
}
.quiz-answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}
.quiz-answer-opt {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px 24px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
}
.quiz-answer-opt:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--color-blue);
    transform: translateY(-2px);
}
.quiz-answer-opt:focus {
    outline: none;
}
.quiz-answer-opt.correct {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--color-green) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}
.quiz-answer-opt.incorrect {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: var(--color-red) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
    animation: shake 0.4s ease;
}
.quiz-answer-opt.disabled {
    pointer-events: none;
    opacity: 0.6;
}
.quiz-answer-opt.disabled.correct, .quiz-answer-opt.disabled.incorrect {
    opacity: 1;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.quiz-feedback-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}
.feedback-message {
    font-size: 15px;
    font-weight: 600;
}

/* Results screen */
.quiz-results {
    text-align: center;
}
.results-trophy {
    font-size: 72px;
    margin-bottom: 16px;
    filter: drop-shadow(0 0 15px var(--color-yellow));
    animation: bounce 2s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.results-score-big {
    font-size: 64px;
    font-family: var(--font-header);
    font-weight: 800;
    line-height: 1;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--color-blue), var(--color-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.results-comment {
    color: var(--text-secondary);
    margin-bottom: 30px;
}
.results-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Modal Backing & Box Styles */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 10, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-container {
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.modal-title {
    display: flex;
    align-items: center;
    gap: 16px;
}
.modal-flag {
    font-size: 40px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.modal-flag-img {
    width: 60px;
    height: auto;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.modal-title h2 {
    font-family: var(--font-header);
    font-size: 22px;
    font-weight: 700;
}
.modal-country-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.modal-close:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.modal-tabs {
    display: flex;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow-x: auto;
}
.modal-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    padding: 14px 18px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
}
.modal-tab-btn:hover {
    color: var(--text-primary);
}
.modal-tab-btn.active {
    color: var(--color-blue);
    border-color: var(--color-blue);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}
.modal-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}
.modal-tab-content.active {
    display: block;
}

/* General tab table */
.modal-table {
    width: 100%;
    border-collapse: collapse;
}
.modal-table td {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.modal-table td:first-child {
    width: 180px;
    color: var(--text-secondary);
}
.modal-table tr:last-child td {
    border-bottom: none;
}

/* Language tab */
.modal-section {
    margin-bottom: 20px;
}
.modal-section h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-blue);
    margin-bottom: 10px;
}
.letter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.letter-badge {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.2);
    color: var(--color-blue);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}
.words-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.word-pair {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 14px;
}
.word-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.word-val {
    font-weight: 600;
    color: var(--text-primary);
}

/* Infra tab */
.infra-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.infra-item {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
}
.infra-icon {
    font-size: 24px;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.infra-item h4 {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text-primary);
}
.infra-item p {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Camera tab */
.camera-info-container {
    display: flex;
    gap: 20px;
    background: rgba(0, 229, 255, 0.02);
    border: 1px solid rgba(0, 229, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    align-items: center;
}
.camera-meta-icon {
    font-size: 40px;
    filter: drop-shadow(0 0 10px var(--color-blue));
}
.camera-info-container h4 {
    margin-bottom: 6px;
}
.camera-info-container p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Tips tab */
.modal-tips-list {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal-tips-list li {
    font-size: 14px;
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Footer Styling */
.app-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--glass-border);
    font-size: 13px;
    color: var(--text-secondary);
}

/* Media Queries for Responsiveness */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .flashcards-layout {
        grid-template-columns: 1fr;
    }
    .app-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .app-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    .quiz-answers-grid {
        grid-template-columns: 1fr;
    }
    .quiz-settings {
        grid-template-columns: 1fr;
    }
}

/* Card Cover Styles */
.card-cover {
    width: 100%;
    height: 140px;
    overflow: hidden;
    position: relative;
    background: #15152a;
    border-bottom: 1px solid var(--glass-border);
}
.card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.country-card:hover .card-cover-img {
    transform: scale(1.1);
}

/* Modal Landscape/Vegetation Image Styles */
.infra-image-container {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.modal-infra-img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
}

/* Flashcard Landscape/Vegetation Guessing Styles */
.fc-ans-landscape-container {
    width: 100%;
    max-width: 500px;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
}
.fc-ans-landscape-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.fc-card:hover .fc-ans-landscape-img {
    transform: scale(1.05);
}

/* Mobile Devices Optimization (max-width: 600px) */
@media (max-width: 600px) {
    .hero-section {
        margin-bottom: 30px;
    }
    .hero-section h1 {
        font-size: 32px;
        letter-spacing: -0.5px;
    }
    .hero-subtitle {
        font-size: 14px;
    }
    
    .logo {
        font-size: 20px;
    }
    .logo-icon {
        font-size: 24px;
    }
    .nav-link {
        padding: 8px 14px;
        font-size: 13px;
    }
    .app-header {
        padding: 16px 0;
    }
    .app-content {
        padding: 20px 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
    .stat-value {
        font-size: 22px;
    }
    
    .dashboard-main, .dashboard-sidebar {
        padding: 20px;
    }
    .rec-item {
        padding: 14px;
        gap: 14px;
    }
    .rec-icon {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    .rec-info h3 {
        font-size: 14px;
    }
    
    .search-filters-bar {
        padding: 16px;
    }
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    /* Modal Optimizations */
    .modal-container {
        max-height: 95vh;
        border-radius: 12px;
    }
    .modal-header {
        padding: 16px;
    }
    .modal-flag-img {
        width: 48px;
    }
    .modal-title h2 {
        font-size: 18px;
    }
    .modal-body {
        padding: 16px;
    }
    .modal-tab-btn {
        padding: 10px 12px;
        font-size: 12px;
    }
    .modal-table td {
        display: block;
        width: 100% !important;
        padding: 6px 0;
    }
    .modal-table td:first-child {
        font-weight: 700;
        border-bottom: none;
        padding-bottom: 2px;
    }
    .words-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    /* Flashcards Mobile view */
    .fc-card-wrapper {
        height: 340px;
    }
    .fc-card-face {
        padding: 20px;
    }
    .fc-clue-item {
        font-size: 15px;
    }
    .fc-ans-title {
        font-size: 24px;
    }
    .fc-ans-subtitle {
        font-size: 15px;
    }
    .fc-ans-landscape-container {
        height: 160px;
    }
    .fc-controls {
        flex-direction: column;
        gap: 10px;
    }
    .fc-controls .btn {
        width: 100%;
        padding: 12px;
    }
    
    /* Quiz Mobile View */
    .quiz-container {
        padding: 20px;
    }
    .quiz-question-text {
        font-size: 18px;
    }
    .quiz-answer-opt {
        padding: 12px 16px;
        font-size: 14px;
    }
    .quiz-settings {
        gap: 12px;
    }
    .results-score-big {
        font-size: 48px;
    }
}
