/* themes.css - iOS Color Scheme and Theme Variables */

/* CSS Custom Properties based on iOS ThemeManager.swift */
:root {
    /* Primary Colors */
    --background-color: rgb(31, 31, 36);           /* iOS: backgroundColor */
    --card-background: rgb(46, 46, 56);            /* iOS: cardBackgroundColor */
    --card-background-color: var(--card-background);
    --accent-color: rgb(247, 148, 89);             /* iOS: accentColor */
    --secondary-accent: rgb(255, 193, 7);
    
    /* Text Colors */
    --text-primary: rgba(255, 255, 255, 0.95);     /* iOS: primaryTextColor */
    --text-secondary: rgba(255, 255, 255, 0.6);    /* iOS: secondaryTextColor */
    --text-accent: rgba(255, 255, 255, 0.8);       /* iOS: accentTextColor */
    
    /* Chessboard Colors */
    --light-square-color: rgb(240, 217, 181);       /* iOS: lightSquareColor */
    --dark-square-color: rgb(181, 136, 99);         /* iOS: darkSquareColor */
    
    /* UI Element Colors */
    --button-grey: rgba(255, 255, 255, 0.15);       /* iOS: buttonGreyColor */
    --button-disabled: rgba(255, 255, 255, 0.05);   /* Disabled button state */
    --border-color: rgba(255, 255, 255, 0.12);      /* iOS: borderColor */
    --separator-color: rgba(255, 255, 255, 0.08);
    
    /* Status Colors */
    --success-color: rgb(76, 217, 102);              /* iOS: successColor */
    --error-color: rgb(230, 77, 77);                 /* iOS: errorColor */
    --warning-color: rgb(255, 193, 7);               /* iOS: warningColor */
    
    /* Shadow and Effects */
    --shadow-color: rgba(0, 0, 0, 0.25);
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-heavy: rgba(0, 0, 0, 0.4);
    
    /* Interactive States */
    --hover-overlay: rgba(255, 255, 255, 0.1);
    --active-overlay: rgba(255, 255, 255, 0.2);
    --disabled-overlay: rgba(255, 255, 255, 0.02);
    
    /* Color Indicators */
    --white-player-color: rgba(255, 255, 255, 0.9);
    --black-player-color: rgba(40, 40, 40, 0.9);
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography Scale */
h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

h4 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

p {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Common Card Styling */
.card {
    background-color: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px var(--shadow-color);
}

/* Button Base Styling */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Interactive Elements */
.interactive:hover {
    background-color: var(--hover-overlay);
}

.interactive:active {
    background-color: var(--active-overlay);
    transform: scale(0.98);
}

/* Utility Classes */
.hidden {
    visibility: hidden !important;
}

.visible {
    visibility: visible !important;
}

.text-primary {
    color: var(--text-primary);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-accent {
    color: var(--text-accent);
}

.bg-primary {
    background-color: var(--background-color);
}

.bg-card {
    background-color: var(--card-background);
}

.bg-accent {
    background-color: var(--accent-color);
}

/* Color Indicator Styles */
.color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background-color: var(--card-background);
    position: relative;
    display: inline-block;
}

.color-indicator.white {
    background-color: var(--white-player-color);
    border-color: rgba(0, 0, 0, 0.2);
}

.color-indicator.black {
    background-color: var(--black-player-color);
    border-color: rgba(255, 255, 255, 0.3);
}


/* FORCE HIDE points display */
.points-display,
#pointsDisplay,
#puzzlePointsDisplay,
#mobilePointsDisplay {
    display: none !important;
    visibility: hidden !important;
}

.star-icon {
    color: #FFD700;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.points-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Responsive Typography */
@media (max-width: 768px) {
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .points-display {
        padding: 6px 10px;
        min-width: 70px;
    }
    
    .star-icon {
        font-size: 14px;
    }
    
    .points-value {
        font-size: 14px;
    }
}

@media (max-width: 375px) {
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .points-display {
        padding: 4px 8px;
        min-width: 60px;
    }
    
    .star-icon {
        font-size: 12px;
    }
    
    .points-value {
        font-size: 12px;
    }
}

/* Dark Mode Support (already in dark theme) */
@media (prefers-color-scheme: light) {
    /* Could add light theme overrides here if needed */
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    :root {
        --text-primary: rgba(255, 255, 255, 1.0);
        --text-secondary: rgba(255, 255, 255, 0.8);
        --border-color: rgba(255, 255, 255, 0.3);
        --button-grey: rgba(255, 255, 255, 0.25);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        color: black;
    }
    
    .card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

