/**
 * Global Styles for Kids Learning Games
 * Foundation CSS for all games
 */

:root {
    /* Color Palette */
    --primary-bright: #FF6B6B;
    --primary-teal: #4ECDC4;
    --primary-yellow: #FFE66D;
    --pastel-pink: #FFB6C1;
    --pastel-blue: #87CEEB;
    --pastel-green: #98D8C8;
    --accent-hot-pink: #FF1493;
    --accent-cyan: #00CED1;
    --accent-gold: #FFD700;
    
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #F5F5F5;
    --bg-white: #FFFFFF;
    
    /* Typography */
    --font-main: 'Arial', 'Helvetica', sans-serif;
    --font-size-large: 48px;
    --font-size-medium: 32px;
    --font-size-normal: 24px;
    --font-size-small: 18px;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-xxl: 48px;
    
    /* Shadows */
    --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);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #FFE66D 0%, #4ECDC4 50%, #FF6B6B 100%);
    color: var(--text-dark);
    overflow-x: hidden;
    touch-action: manipulation;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-dark);
}

h1 {
    font-size: var(--font-size-large);
    margin-bottom: var(--space-lg);
}

h2 {
    font-size: var(--font-size-medium);
    margin-bottom: var(--space-md);
}

h3 {
    font-size: var(--font-size-normal);
    margin-bottom: var(--space-md);
}

p {
    font-size: var(--font-size-small);
    line-height: 1.6;
    color: var(--text-light);
}

/* Buttons - Large touch targets */
button, .btn {
    font-family: var(--font-main);
    font-size: var(--font-size-normal);
    font-weight: 600;
    padding: var(--space-md) var(--space-lg);
    min-height: 56px;
    min-width: 56px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
}

button:active, .btn:active {
    transform: scale(0.95);
}

button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-bright), #FF5252);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, var(--primary-teal), #3CB7B5);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, var(--primary-yellow), #FFD54F);
    color: var(--text-dark);
}

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

.btn-outline:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Links */
a {
    color: var(--primary-teal);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-cyan);
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-full {
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 100%;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: var(--space-lg);
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

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

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

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

/* Flex Layouts */
.flex {
    display: flex;
    gap: var(--space-md);
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

/* Badges & Labels */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    min-width: 32px;
}

.badge-primary {
    background: var(--primary-bright);
    color: white;
}

.badge-success {
    background: #4CAF50;
    color: white;
}

.badge-warning {
    background: var(--primary-yellow);
    color: var(--text-dark);
}

.badge-info {
    background: var(--pastel-blue);
    color: var(--text-dark);
}

/* Stars Display */
.stars {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.star {
    font-size: 28px;
    animation: twinkle 1.5s ease-in-out infinite;
}

.star:nth-child(2) {
    animation-delay: 0.3s;
}

.star:nth-child(3) {
    animation-delay: 0.6s;
}

.star-empty {
    opacity: 0.3;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-bright), var(--accent-gold));
    transition: width var(--transition-slow);
    border-radius: var(--radius-full);
}

/* Input Fields */
input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
    font-family: var(--font-main);
    font-size: var(--font-size-small);
    padding: var(--space-md);
    border: 2px solid #ddd;
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast);
    width: 100%;
    max-width: 100%;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

.hidden { display: none !important; }
.visible { display: block !important; }

.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }

.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive Typography */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 22px;
    }

    p {
        font-size: 16px;
    }

    button, .btn {
        font-size: 18px;
        padding: var(--space-md) var(--space-lg);
    }
}

@media (max-width: 480px) {
    :root {
        --space-lg: 16px;
        --space-md: 12px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }

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

/* Print Styles */
@media print {
    body {
        background: white;
    }

    button, .btn {
        display: none;
    }
}
