/* CSS Variables */
:root {
    --color-primary: #3B82F6;
    --color-primary-dark: #2563EB;
    --color-secondary: #10B981;
    --color-bg: #F8FAFC;
    --color-card: #FFFFFF;
    --color-text: #1E293B;
    --color-text-light: #64748B;
    --color-border: #E2E8F0;
    --color-us: #EF4444;
    --color-eu: #3B82F6;
    --color-uk: #6366F1;
    --color-ar: #22D3EE;
    --transition-speed: 0.2s;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 24px 0;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* Main */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Sections */
.section {
    background: var(--color-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

.section.hidden {
    display: none;
}

.section-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Category Buttons */
.category-buttons,
.gender-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-btn,
.gender-btn,
.kids-btn {
    flex: 1;
    min-width: 90px;
    min-height: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-speed);
    touch-action: manipulation;
}

.category-btn:hover,
.gender-btn:hover,
.kids-btn:hover {
    border-color: var(--color-primary);
    background: #EFF6FF;
}

.category-btn:active,
.gender-btn:active,
.kids-btn:active {
    transform: scale(0.97);
}

.category-btn.active,
.gender-btn.active,
.kids-btn.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.btn-icon {
    font-size: 1.5rem;
}

.btn-text {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Select */
.select-wrapper {
    position: relative;
}

.select {
    width: 100%;
    min-height: 52px;
    padding: 12px 40px 12px 16px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all var(--transition-speed);
}

.select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--color-text-light);
    pointer-events: none;
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.results-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
}

.results-note {
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.result-card {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    border: 2px solid var(--color-border);
    transition: all var(--transition-speed);
}

.result-card.highlight {
    border-color: var(--color-secondary);
    background: #ECFDF5;
}

.result-card.us { border-left: 4px solid var(--color-us); }
.result-card.eu { border-left: 4px solid var(--color-eu); }
.result-card.uk { border-left: 4px solid var(--color-uk); }
.result-card.ar { border-left: 4px solid var(--color-ar); }

.result-flag {
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.result-country {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

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

.result-extra {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 4px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0 16px;
    color: var(--color-text-light);
    font-size: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

/* Tablet and up */
@media (min-width: 480px) {
    .container {
        padding: 24px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .results-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .result-card {
        padding: 20px 12px;
    }
}

/* Desktop */
@media (min-width: 768px) {
    .container {
        padding: 32px;
    }

    .section {
        padding: 20px;
    }

    .category-btn,
    .gender-btn,
    .kids-btn {
        min-height: 80px;
    }
}
