/**
 * UNIFIED DESIGN SYSTEM
 * Shared visual identity for Arcade Catcher, Memory Match with Traps, and Tic Tac Toe
 */

/* ===== COLOR PALETTE ===== */
:root {
    /* Primary Brand Colors */
    --primary-start: #667eea;
    --primary-end: #764ba2;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);

    /* Accent Colors */
    --accent-cyan: #00d9ff;
    --accent-cyan-light: #4facfe;
    --accent-green: #00ff88;
    --accent-pink: #f093fb;
    --accent-orange: #feca57;
    --accent-red: #ff6b6b;

    /* Status Colors */
    --success: #00ff88;
    --warning: #feca57;
    --danger: #ff6b6b;
    --info: #4facfe;

    /* Background Colors */
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-light: rgba(255, 255, 255, 0.95);
    --bg-dark: rgba(15, 15, 35, 0.95);

    /* Text Colors */
    --text-light: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --text-muted: #888888;

    /* Gradients */
    --gradient-cyan-green: linear-gradient(90deg, #00d9ff, #00ff88);
    --gradient-pink-red: linear-gradient(90deg, #f093fb, #f5576c);
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-blue: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-orange: linear-gradient(135deg, #feca57 0%, #ff6b6b 100%);
    --gradient-red: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

/* ===== TYPOGRAPHY ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Heading Scale */
h1 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* Body Text */
.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.text-light {
    color: var(--text-light);
}

/* ===== BUTTONS ===== */
.btn {
    padding: 15px 40px;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    font-weight: bold;
    color: #0f0f23;
    background: var(--gradient-cyan-green);
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 30px rgba(0, 217, 255, 0.5);
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--gradient-purple);
    color: white;
}

.btn-secondary:hover {
    box-shadow: 0 5px 30px rgba(102, 126, 234, 0.5);
}

.btn-danger {
    background: var(--gradient-red);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 5px 30px rgba(235, 51, 73, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--primary-start);
    border: 2px solid var(--primary-start);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-start);
    color: white;
}

/* Small Button Variant */
.btn-sm {
    padding: 10px 20px;
    font-size: 0.9rem;
    border-radius: 8px;
    letter-spacing: 1px;
}

/* Icon Button */
.btn-icon {
    padding: 10px 15px;
    min-width: 50px;
}

/* ===== CARDS & CONTAINERS ===== */
.card {
    background: var(--bg-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.game-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: var(--bg-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* ===== MODALS & OVERLAYS ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-body {
    margin-bottom: 30px;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: inherit;
    z-index: 100;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 0 40px rgba(102, 126, 234, 0.8); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
    background: var(--gradient-cyan-green);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-purple {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-pink {
    background: var(--gradient-pink-red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-red {
    background: var(--gradient-red);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hidden {
    display: none !important;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 1.5rem; }
.mb-3 { margin-bottom: 2rem; }

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 768px) {
    .game-container {
        padding: 20px;
    }

    .modal-content {
        padding: 25px;
    }

    .btn {
        padding: 12px 30px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }

    .modal-content {
        padding: 20px;
    }

    .btn {
        padding: 10px 25px;
        font-size: 0.85rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }
}

/* ===== GAME-SPECIFIC OVERRIDES ===== */
/* These will be used by individual games as needed */

/* Score Displays */
.score-display {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--gradient-purple);
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.stat-item.success {
    background: var(--gradient-cyan-green);
    color: #0f0f23;
}

.stat-item.warning {
    background: var(--gradient-orange);
    color: #0f0f23;
}

.stat-item.danger {
    background: var(--gradient-red);
    color: white;
}

/* Instructions */
.instructions {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    text-align: left;
}

.instructions ul {
    margin-left: 20px;
    margin-top: 10px;
}

.instructions li {
    margin-bottom: 8px;
}

/* Final Score Display */
.final-score {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: bold;
    color: var(--accent-cyan);
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
}
