/* Common styles shared across all Uncrossy pages */

/* Base Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 10px;
    background-color: #f5f5f5;
    
    box-sizing: border-box;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header, .game-header {
    text-align: center;
    margin-bottom: 30px;
}

.game-header {
    margin-bottom: 10px;
}

/* Site title - UNCROSSY */
.header h1, .game-header h1 {
    display: inline-block; /* Shrink element to text width for proper gradient display */
    margin: 0 0 10px 0;
    color: #3498db; /* Fallback color for older browsers */
    background: linear-gradient(90deg, #3498db 0%, #9b59b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 36px;
    font-weight: bold;
}

/* Page subtitles */
.header h2 {
    margin: 0;
    color: #666;
    font-size: 24px;
    font-weight: normal;
}

/* Button Styles */
button {
    padding: 12px 20px;
    margin: 5px;
    border: none;
    border-radius: 6px;
    background: #4CAF50;
    color: white;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    min-width: 120px;
}

button:hover {
    background: #45a049;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Button color variants */
button.primary {
    background: #4CAF50;
}

button.primary:hover {
    background: #45a049;
}

button.primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

button.secondary {
    background: #2196F3;
}

button.secondary:hover {
    background: #1976D2;
}

button.secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

button.warning {
    background: #ff9800;
}

button.warning:hover {
    background: #e68900;
}

button.warning:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Icon buttons */
button.icon-button {
    min-width: 50px;
    padding: 12px;
}

/* Compact buttons for hint and reset */
button.compact-button {
    min-width: 80px;
    padding: 12px 16px;
}

button img {
    width: 20px;
    height: 20px;
    display: block;
    margin: 0 auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

button.icon-button:hover img {
    transform: scale(1.1);
}

button:disabled img {
    opacity: 0.5;
}

/* Navigation Components */
.navigation-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.navigation-buttons button {
    background: #2196F3;
    min-width: 90px;
}

.navigation-buttons button:hover {
    background: #1976D2;
}

/* Footer Buttons */
.footer-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.footer-buttons button {
    padding: 12px 24px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    min-width: 120px;
}

.footer-buttons button:hover {
    background: #45a049;
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #333;
    color: white;
    padding: 20px;
    z-index: 1002;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    display: none;
}

.cookie-consent-banner.show {
    display: block;
}

.cookie-consent-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-consent-text {
    flex: 1;
    min-width: 300px;
    line-height: 1.4;
}

.cookie-consent-text a {
    color: #4CAF50;
    text-decoration: none;
}

.cookie-consent-text a:hover {
    text-decoration: underline;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-consent-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    min-width: auto;
}

.cookie-consent-buttons .accept-essential {
    background: #666;
    color: white;
}

.cookie-consent-buttons .accept-all {
    background: #4CAF50;
    color: white;
}

.cookie-consent-buttons button:hover {
    opacity: 0.9;
}

/* Hamburger Menu Styles */
.hamburger-button {
    position: fixed;
    top: 15px;
    right: 15px;
    width: 50px;
    height: 50px;
    padding: 0;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath stroke='%23000' stroke-width='3' stroke-linecap='round' d='M5 8h20M5 15h20M5 22h20'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 30px 30px;
    border: 2px solid #ddd;
    border-radius: 8px;
    line-height: 1;
    z-index: 900;
    min-width: 50px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hamburger-button:hover {
    background: #f5f5f5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath stroke='%23555' stroke-width='3' stroke-linecap='round' d='M5 8h20M5 15h20M5 22h20'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 30px 30px;
    border-color: #999;
}

/* Menu Modal Styles */
.menu-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.menu-modal.show {
    display: block;
}

.menu-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease-in;
}

.menu-dialog {
    position: absolute;
    top: 80px;
    right: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 20px;
    min-width: 250px;
    animation: slideDown 0.2s ease-out;
}

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.menu-item {
    width: 100%;
    padding: 15px 20px;
    text-align: left;
    font-size: 18px;
    border-radius: 8px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    min-width: auto;
    color: black;  /* Ensure menu text is black for better readability */
}

.menu-item:hover {
    background: #e8e8e8;
    border-color: #999;
}

.menu-item.primary {
    background: #4CAF50;
    color: white;
    border: none;
}

.menu-item.primary:hover {
    background: #45a049;
}

.menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.menu-item.disabled:hover {
    background: #f8f8f8;
}

/* Play Now Modal Styles */
.play-now-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 800; /* Lower than menu modal (1000) so hamburger menu remains accessible */
}

.play-now-modal.show {
    display: block;
}

.play-now-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease-in;
}

.play-now-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 30px;
    min-width: 320px;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.3s ease-out;
}

.play-now-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 25px;
}

.play-now-text {
    font-size: 18px;
    line-height: 1.5;
    color: #333;
}

.play-now-text h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: bold;
    color: #2c5530;
}

.play-now-text .puzzle-date {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c5530;
}

.play-now-text .completion-status {
    font-size: 16px;
    color: #666;
    margin-top: 8px;
}

.play-now-text .completion-status.completed {
    color: #4CAF50;
    font-weight: 500;
}

.play-now-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.play-now-button, .visit-archive-button {
    width: 100%;
    padding: 15px 25px;
    font-size: 18px;
    border-radius: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.play-now-button.primary {
    background: #4CAF50;
    color: white;
}

.play-now-button.primary:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.visit-archive-button.secondary {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
}

.visit-archive-button.secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9); 
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1); 
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }
    
    .container {
        padding: 10px;
    }
    
    .header, .game-header {
        margin-top: 30px;
        margin-bottom: 8px;
    }
    
    .header h1, .game-header h1 {
        margin: 0 0 5px 0;
        font-size: 32px;
    }
    
    .header h1 {
        font-size: 28px;
    }
    
    .header h2 {
        font-size: 20px;
    }
    
    .footer-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-buttons button {
        width: 200px;
    }
    
    /* Cookie consent mobile styles */
    .cookie-consent-banner {
        padding: 15px;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .cookie-consent-text {
        min-width: auto;
        font-size: 14px;
    }
    
    .cookie-consent-buttons {
        justify-content: center;
    }
    
    /* Hamburger menu mobile adjustments */
    .menu-dialog {
        top: 70px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
    
    .menu-item {
        font-size: 16px;
        padding: 12px 16px;
    }
    
    /* Play Now Modal mobile styles */
    .play-now-dialog {
        padding: 25px 20px;
        min-width: 280px;
        width: 85%;
    }
    
    .play-now-text h3 {
        font-size: 22px;
    }
    
    .play-now-text .puzzle-date {
        font-size: 18px;
    }
    
    .play-now-button, .visit-archive-button {
        padding: 12px 20px;
        font-size: 16px;
    }
}