/* 
 * styles.css
 * Variables globales, normalizaciones y estilos estructurales base
 * v1.2.0
 */

/* Variables CSS globales y configuración de tema */
:root {
    --bg-primary: #f5f7fa;
    --bg-secondary: #e9ecef;
    --bg-tertiary: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --primary-color: #3b82f6;
    --accent-color: #4f46e5;
    --red-color: #ef4444;
    --green-color: #22c55e;
    --volume-percentage: 75%;
}

.dark-mode {
    --bg-primary: #0a0e17;        /* Negro azulado profundo para el fondo principal */
    --bg-secondary: #111827;      /* Negro azulado ligeramente más claro para elementos secundarios */
    --bg-tertiary: #070b15;       /* Negro azulado más profundo para tarjetas */
    --text-primary: #f8fafc;      /* Blanco con ligero tinte azulado */
    --text-secondary: #cbd5e1;    /* Gris azulado claro */
    --border-color: #2563eb;      /* Azul brillante predeterminado para bordes genéricos */
    
    /* Colores específicos para los bordes de secciones */
    --entrada-color: #3b82f6;     /* Azul brillante */
    --perdon-color: #8b5cf6;      /* Púrpura/violeta */
    --evangelio-color: #f59e0b;   /* Ámbar/naranja */
    --ofertorio-color: #10b981;   /* Verde esmeralda */
    --santo-color: #06b6d4;       /* Cian */
    --paz-color: #3b82f6;         /* Azul brillante */
    --comunion-color: #ef4444;    /* Rojo */
    --virgen-color: #ec4899;      /* Rosa */
    --rosario-color: #9c27b0;     /* Púrpura */
    
    /* Gradiente para control de volumen */
    --volume-gradient-start: #3b82f6;  /* Azul */
    --volume-gradient-end: #8b5cf6;    /* Púrpura */
}

/* Normalización y resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

body, html {
    height: 100%;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding-bottom: 20px;
}

/* Tipografía base */
h1, h2, h3 {
    color: var(--text-primary);
    font-weight: 600;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* Estilos base de botones */
button {
    cursor: pointer;
    border: none;
    background: none;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Estructura del Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-title {
    display: flex;
    align-items: center;
}

.header-title h1 {
    font-size: 1.25rem;
    margin-left: 0.5rem;
}

.header-title svg {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Header principal con logo */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(to right, var(--volume-gradient-start, #3b82f6), var(--volume-gradient-end, #8b5cf6));
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

/* Contenedores laterales y central */
.header-left, 
.header-right {
    width: 20%;
}

.header-center {
    width: 60%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Contenedor del logo */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
}

/* Footer */
footer {
    padding: 1.5rem 1rem;
    text-align: center;
    background: linear-gradient(to right, var(--volume-gradient-start, #3b82f6), var(--volume-gradient-end, #8b5cf6));
    color: white;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

footer a {
    color: white;
    text-decoration: underline;
    transition: all 0.2s ease;
}

footer a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.footer-logo {
    max-width: 120px;
    margin: 0.75rem auto 0;
    display: block;
    filter: brightness(1.1);
}

/* Fix para SVG en diversos browsers */
svg {
    display: inline-block;
    vertical-align: middle;
}

/* Clases de utilidad */
.hidden {
    display: none !important;
}

.flex {
    display: flex !important;
}

.items-center {
    align-items: center !important;
}

.justify-center {
    justify-content: center !important;
}

.mr-1 {
    margin-right: 0.25rem !important;
}

.mt-1 {
    margin-top: 0.25rem !important;
}

.w-full {
    width: 100% !important;
}

.h-2 {
    height: 0.5rem !important;
}

/* Contenedores principales de secciones */
.quick-actions-section,
.volume-control-section,
.categories-section,
.player-section {
    padding: 1rem;
    margin: 0 1rem 1rem 1rem; /* Alineación uniforme de todos los contenedores */
    background-color: var(--bg-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Animaciones globales */
@keyframes pulse {
    0% { transform: scale(0.8); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.8; }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.8); }
    100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Media queries base - Estructura responsiva para móviles */
@media (max-width: 768px) {
    .header-left, 
    .header-right {
        width: 10%;
    }
    
    .header-center {
        width: 80%;
    }
    
    .header-logo {
        width: 80px;
    }
    
    .header-title {
        font-size: 1.2rem;
    }
    
    .app-header {
        padding: 0.5rem;
        margin: 0 0.5rem 0.75rem 0.5rem;
    }
    
    .app-header .header-title h1 {
        font-size: 1rem;
    }
    
    /* Ajustes responsivos adicionales para mantener consistencia */
    .quick-actions-section,
    .volume-control-section,
    .categories-section,
    .player-section {
        margin: 0 0.5rem 1rem 0.5rem;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 0.5rem 0.25rem;
    }
    
    .header-center {
        width: 90%;
    }
    
    .header-left, 
    .header-right {
        width: 5%;
    }
    
    .header-logo {
        max-width: 100px;
    }
    
    .header-title {
        font-size: 1rem;
    }
    
    /* Footer para pantallas muy pequeñas */
    footer p {
        font-size: 0.8rem;
    }
    
    .footer-logo {
        max-width: 100px;
    }
    
    /* Ajuste para las secciones en móvil */
    .quick-actions-section,
    .volume-control-section,
    .categories-section,
    .player-section {
        margin: 0 0.25rem 0.75rem 0.25rem;
        padding: 0.5rem;
    }
}

/* Mejoras para orientación landscape en móviles */
@media (max-height: 480px) and (orientation: landscape) {
    .main-header {
        padding: 0.25rem;
    }
    
    .header-logo {
        max-width: 80px;
        margin-bottom: 0;
    }
    
    .logo-container {
        flex-direction: row;
        gap: 1rem;
        align-items: center;
    }
    
    .header-title {
        font-size: 1rem;
        margin: 0;
    }
    
    footer {
        padding: 1rem 0.5rem;
    }
    
    .footer-logo {
        max-width: 80px;
    }
}

/* Prevención de desbordamiento de texto */
.header-title, footer p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    -ms-word-break: break-word;
    word-break: break-word;
    hyphens: auto;
}