/* Responsive Design for 10x10 Chess Board */

/* Tablet Styles */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Game Layout for Tablet */
    .game-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .game-sidebar {
        position: static;
        max-height: none;
        order: 2;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-md);
    }
    
    .chess-board {
        width: min(80vw, 550px); /* Adjusted for 10x10 */
        height: min(80vw, 550px);
    }
    
    .fullscreen .game-container {
        grid-template-columns: 1fr;
    }
    
    .fullscreen .game-sidebar {
        order: -1;
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-sm);
        padding: var(--spacing-md);
    }
    
    .fullscreen .chess-board {
        width: min(90vw, 90vh);
        height: min(90vw, 90vh);
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--background-light);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-light);
        padding: var(--spacing-lg) 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-item {
        margin: var(--spacing-sm) 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    /* Hero Section */
    .hero-section {
        padding: var(--spacing-xl) 0;
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .chess-board-preview {
        width: 250px;
        height: 250px;
    }
    
    /* Page Styles */
    .page-hero h1 {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-card {
        padding: var(--spacing-lg);
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    /* Content Sections */
    .content-section {
        padding: var(--spacing-lg);
    }
    
    .legal-text {
        padding: var(--spacing-lg);
    }
    
    /* Game Layout for Mobile */
    .game-main {
        padding: var(--spacing-md) 0;
    }
    
    .game-container {
        padding: 0 var(--spacing-sm);
        gap: var(--spacing-md);
    }
    
    .game-sidebar {
        padding: var(--spacing-md);
        display: block;
    }
    
    .move-history .history-list {
        max-height: 150px;
    }
    
    .chess-board {
        width: min(95vw, 450px); /* Adjusted for 10x10 */
        height: min(95vw, 450px);
    }
    
    .chess-square {
        font-size: 1.6rem; /* Smaller for mobile 10x10 */
    }
    
    .board-coordinates .files,
    .board-coordinates .ranks {
        font-size: 0.7rem; /* Smaller for 10x10 */
    }
    
    /* Modal Adjustments */
    .modal-content {
        width: 95%;
        padding: var(--spacing-lg);
        margin: var(--spacing-md);
    }
    
    .promotion-pieces {
        gap: var(--spacing-md);
    }
    
    .promotion-piece {
        font-size: 2.5rem;
        padding: var(--spacing-sm);
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    /* Fullscreen on Mobile */
    .fullscreen .game-container {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .fullscreen .game-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
        padding: var(--spacing-sm);
    }
    
    .fullscreen .game-sidebar h3,
    .fullscreen .game-sidebar h4 {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .fullscreen .control-buttons {
        flex-direction: row;
        gap: var(--spacing-xs);
    }
    
    .fullscreen .control-buttons .btn {
        font-size: 0.8rem;
        padding: var(--spacing-xs);
    }
    
    .fullscreen .chess-board {
        width: min(95vw, 95vh);
        height: min(95vw, 95vh);
    }
    
    /* Form Adjustments */
    .hero-buttons {
        gap: var(--spacing-sm);
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
    
    .btn-large {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .page-hero h1 {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .nav-logo h1 {
        font-size: 1.5rem;
    }
    
    .chess-board {
        width: min(90vw, 380px); /* Adjusted for 10x10 */
        height: min(90vw, 380px);
    }
    
    .chess-square {
        font-size: 1.4rem; /* Even smaller for small mobile 10x10 */
    }
    
    .game-sidebar {
        padding: var(--spacing-sm);
    }
    
    .legal-text {
        padding: var(--spacing-md);
    }
    
    .auth-card {
        padding: var(--spacing-md);
    }
    
    .modal-content {
        padding: var(--spacing-md);
    }
    
    .promotion-piece {
        font-size: 2rem;
        padding: var(--spacing-xs);
    }
    
    .fullscreen .chess-board {
        width: min(90vw, 90vh);
        height: min(90vw, 90vh);
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: 400px;
        padding: var(--spacing-lg) 0;
    }
    
    .game-main {
        padding: var(--spacing-sm) 0;
    }
    
    .fullscreen .game-container {
        grid-template-columns: 250px 1fr;
        gap: var(--spacing-sm);
    }
    
    .fullscreen .game-sidebar {
        display: block;
        grid-template-columns: none;
        padding: var(--spacing-xs);
        font-size: 0.85rem;
    }
    
    .fullscreen .chess-board {
        width: min(80vh, 70vw);
        height: min(80vh, 70vw);
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .game-sidebar,
    .modal,
    .hamburger {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .chess-board {
        width: 500px; /* Adjusted for 10x10 */
        height: 500px;
        break-inside: avoid;
    }
    
    .page-hero {
        background: none;
        color: var(--text-primary);
    }
    
    .hero-section {
        background: none;
        color: var(--text-primary);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .chess-square {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .chess-square,
    .chess-piece,
    .feature-card,
    .btn {
        transition: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --background-light: #1a1a1a;
        --background-gray: #2a2a2a;
        --background-dark: #0f0f0f;
        --border-color: #404040;
    }
    
    .chess-square.light {
        background-color: #d4c4a8;
    }
    
    .chess-square.dark {
        background-color: #8b6f47;
    }
}