/* Estilos principales para THE BIG RED BUTTON */

/* Reset y variables CSS */
:root {
    --primary-color: #e63946;
    --secondary-color: #457b9d;
    --accent-color: #f1faee;
    --text-color: #1d3557;
    --light-text: #a8dadc;
    --background-color: #f8f9fa;
    --card-background: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Contenedor principal */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Cabecera */
.app-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--box-shadow);
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav ul li {
    margin-left: 1.5rem;
}

.main-nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Contenido principal */
.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Contenedor del juego */
.game-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.user-details .username {
    font-weight: bold;
    display: block;
}

.user-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.global-progress {
    flex: 1;
    max-width: 300px;
}

.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--secondary-color);
    transition: width 0.5s ease;
}

/* Sección del puzzle */
.puzzle-section {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.puzzle-category {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.puzzle-phrase {
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 0.5rem;
    margin: 1.5rem 0;
    font-family: monospace;
}

.letters-guessed {
    font-size: 1rem;
    color: var(--light-text);
}

/* Sección del botón */
.button-section {
    text-align: center;
}

.big-button {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(230, 57, 70, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.big-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(230, 57, 70, 0.4);
}

.big-button:active {
    transform: scale(0.95);
}

.big-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.button-status {
    margin-top: 1rem;
    font-style: italic;
    color: var(--secondary-color);
}

/* Sección de adivinanza */
.guess-section {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.guess-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

#letter-input {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    text-transform: uppercase;
}

#guess-button {
    padding: 0 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

#guess-button:hover {
    background-color: #33658a;
}

.guess-result {
    font-weight: bold;
    min-height: 1.5rem;
    color: var(--primary-color);
}

/* Pie de página */
.app-footer {
    background-color: var(--text-color);
    color: white;
    padding: 2rem;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--light-text);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--light-text);
    text-decoration: none;
    transition: var(--transition);
}

.social-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--light-text);
}

/* Mensajes */
.message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Modales */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: var(--transition);
}

.close:hover {
    color: var(--text-color);
}

/* Formularios */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(69, 123, 157, 0.2);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    background-color: #d62828;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #33658a;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.auth-switch a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Página de bienvenida */
.welcome-container {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.welcome-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.welcome-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.welcome-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature {
    background-color: var(--card-background);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.feature p {
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav ul li {
        margin: 0.25rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .global-progress {
        max-width: 100%;
    }
    
    .puzzle-phrase {
        font-size: 1.8rem;
        letter-spacing: 0.25rem;
    }
    
    .big-button {
        width: 150px;
        height: 150px;
        font-size: 1.2rem;
    }
    
    .guess-container {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .welcome-content h1 {
        font-size: 2rem;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
}

/* Animaciones */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
}

/* Efectos de focus */
.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(69, 123, 157, 0.2);
}

/* Estados de los inputs */
.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:valid {
    border-color: #28a745;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}