/* Mobile-first styles for Geografía Argentina */

:root {
    --color-primary: #75AADB;
    --color-primary-dark: #5A8FC0;
    --color-secondary: #F5D547;
    --color-secondary-dark: #E5C537;
    --color-success: #27AE60;
    --color-warning: #F39C12;
    --color-error: #E74C3C;
    --color-bg: #F0F4F8;
    --color-card: #FFFFFF;
    --color-text: #2C3E50;
    --color-text-light: #7F8C8D;
    --color-border: #E0E6ED;

    --transition-speed: 0.3s;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

html, body {
    height: 100%;
    height: 100dvh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Screen management */
.screen {
    display: none;
    flex-direction: column;
    height: 100%;
    height: 100dvh;
}

.screen.active {
    display: flex;
}

/* Header styles */
.header {
    text-align: center;
    padding: 24px 16px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Menu Screen */
.menu-content {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-y: auto;
}

.instructions {
    text-align: center;
    color: var(--color-text-light);
    font-size: 1rem;
    line-height: 1.5;
}

.mode-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Button styles */
.btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    color: var(--color-text);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}

.btn-text {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-desc {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 2px;
}

/* Highscores */
.highscores {
    background: var(--color-card);
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.highscores h3 {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.highscore-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

.highscore-row:last-child {
    border-bottom: none;
}

.highscore-row span:last-child {
    font-weight: 600;
    color: var(--color-primary);
}

/* Game Screen */
.game-header {
    background: var(--color-card);
    padding: 12px 16px;
    box-shadow: var(--shadow-sm);
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.question-counter {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.score {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
}

.question {
    text-align: center;
}

.question-label {
    font-size: 0.85rem;
    color: var(--color-text-light);
    display: block;
    margin-bottom: 2px;
}

.question-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Map container */
.map-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--color-bg);
    overflow: hidden;
    touch-action: none;
}

#map-svg {
    width: 100%;
    height: 100%;
    max-height: calc(100dvh - 200px);
}

/* SVG Provincia styles */
.provincia {
    fill: #E8F0F8;
    stroke: #B0C4D8;
    stroke-width: 1.5;
    cursor: pointer;
    transition: fill 0.2s;
}

.provincia:hover {
    fill: #D0E0F0;
}

.provincia.highlight {
    fill: var(--color-success);
    stroke: var(--color-success);
}

.provincia-caba {
    fill: #FFE0B0;
    stroke: #E0A060;
}

/* Feedback markers */
.marker {
    opacity: 0;
    transition: opacity 0.3s;
}

.marker.visible {
    opacity: 1;
}

.marker-target {
    fill: var(--color-success);
    stroke: white;
    stroke-width: 3;
}

.marker-click {
    fill: var(--color-error);
    stroke: white;
    stroke-width: 2;
}

.feedback-line {
    stroke: var(--color-text);
    stroke-width: 2;
    stroke-dasharray: 6, 4;
    opacity: 0;
    transition: opacity 0.3s;
}

.feedback-line.visible {
    opacity: 0.6;
}

/* Feedback bar */
.feedback-bar {
    background: var(--color-card);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    min-height: 52px;
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.3s, opacity 0.3s;
}

.feedback-bar.visible {
    opacity: 1;
    transform: translateY(0);
}

.feedback-message {
    font-size: 1rem;
    color: var(--color-text);
}

.feedback-points {
    font-size: 1.25rem;
    font-weight: 700;
}

.feedback-points.excellent {
    color: var(--color-success);
}

.feedback-points.good {
    color: var(--color-warning);
}

.feedback-points.poor {
    color: var(--color-error);
}

/* Results Screen */
.results-content {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.results-card {
    background: var(--color-card);
    padding: 32px 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.results-label {
    font-size: 0.9rem;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.results-score {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
}

.results-max {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 8px;
}

.results-highscore {
    display: flex;
    gap: 8px;
    font-size: 1rem;
}

.highscore-label {
    color: var(--color-text-light);
}

.highscore-value {
    font-weight: 600;
    color: var(--color-text);
}

.new-record {
    display: none;
    background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-dark) 100%);
    color: var(--color-text);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    animation: pulse 1s ease-in-out infinite;
}

.new-record.visible {
    display: block;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.results-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    margin-top: auto;
}

.results-buttons .btn {
    padding: 14px 24px;
}

.results-buttons .btn-text {
    font-size: 1rem;
}

/* Responsive - Tablet and up */
@media (min-width: 768px) {
    .menu-content {
        max-width: 500px;
        margin: 0 auto;
        padding: 40px 24px;
    }

    .mode-buttons {
        flex-direction: row;
    }

    .mode-buttons .btn {
        flex: 1;
    }

    .map-container {
        padding: 16px;
    }

    #map-svg {
        max-width: 500px;
    }

    .results-content {
        max-width: 500px;
        margin: 0 auto;
    }
}

/* Disable selection on interactive elements */
.btn,
.map-container,
#map-svg {
    user-select: none;
    -webkit-user-select: none;
}
