/**
 * Estilos del Santo Rosario Interactivo
 * Diseño profesional y elegante
 */

/* Variables específicas del rosario */
:root {
    --rosario-gold: #D4AF37;
    --rosario-gold-light: #FFD700;
    --rosario-gold-dark: #B8860B;
    --rosario-silver: #C0C0C0;
    --rosario-bronze: #8B4513;
    --rosario-wood: #4A3728;
    --rosario-cream: #FAF8F3;
    --rosario-purple: #663399;
    --rosario-joy: #FFD700;
    --rosario-sorrow: #8B4513;
    --rosario-glory: #DAA520;
    --rosario-light: #FFA500;
    --bead-size: 24px;
    --bead-large: 36px;
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contenedor principal */
#rosario-app {
    max-width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--rosario-cream) 0%, #f5f0e6 100%);
    position: relative;
    overflow-x: hidden;
}

#rosario-app::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 69, 19, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.rosario-container {
    position: relative;
    z-index: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header del rosario */
.rosario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.mystery-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mystery-selector label {
    font-weight: 600;
    color: var(--color-primary, #1e3a5f);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mystery-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    color: var(--color-text, #2d3748);
    cursor: pointer;
    transition: var(--transition-smooth);
    min-width: 300px;
}

.mystery-select:hover {
    border-color: var(--rosario-gold);
}

.mystery-select:focus {
    outline: none;
    border-color: var(--rosario-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* Indicador de progreso */
.progress-indicator {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-ring {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 8;
}

.progress-fill {
    fill: none;
    stroke: url(#progress-gradient);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-primary);
}

/* Definición del gradiente SVG */
svg defs {
    display: none;
}

/* Display del misterio */
.mystery-display {
    margin-bottom: 2rem;
}

.mystery-card {
    background: linear-gradient(135deg, white 0%, var(--rosario-cream) 100%);
    border-radius: 24px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
}

.mystery-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mystery-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.mystery-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-primary, #1e3a5f);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.mystery-fruit {
    font-size: 1.1rem;
    color: var(--rosario-gold-dark, #B8860B);
    font-weight: 600;
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 1;
}

.mystery-gospel {
    font-size: 0.9rem;
    color: var(--color-text-light, #4a5568);
    font-style: italic;
    position: relative;
    z-index: 1;
}

.mystery-meditation {
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}

.btn-meditation {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--rosario-purple) 0%, #7B68EE 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(102, 51, 153, 0.3);
}

.btn-meditation:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 51, 153, 0.4);
}

/* Visual del rosario SVG */
.rosary-visual {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    position: relative;
}

#rosary-svg {
    max-width: 400px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.15));
}

.rosary-item {
    cursor: pointer;
    transition: var(--transition-smooth);
}

.rosary-item:hover {
    transform: scale(1.1);
}

.rosary-item.active circle:first-child {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.rosary-item.completed circle:first-child {
    fill: #228B22 !important;
}

.rosary-item.pater circle:first-child {
    stroke: var(--rosario-gold);
    stroke-width: 3;
}

/* Display de oración */
.prayer-display {
    max-width: 700px;
    margin: 0 auto 2rem;
}

.prayer-card {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 15px 50px rgba(0,0,0,0.1);
    text-align: center;
}

.prayer-type {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--rosario-gold) 0%, var(--rosario-gold-light) 100%);
    color: var(--color-primary-dark, #1e3a5f);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 50px;
    margin-bottom: 1.5rem;
}

.prayer-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--color-primary, #1e3a5f);
    margin-bottom: 1.5rem;
}

.prayer-text-content {
    font-size: 1.2rem;
    line-height: 2;
    color: var(--color-text, #2d3748);
    white-space: pre-line;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--rosario-cream) 0%, white 100%);
    border-radius: 16px;
    border-left: 4px solid var(--rosario-gold);
    text-align: left;
}

/* Controles de oración */
.prayer-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.prayer-controls button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-prev {
    background: #e2e8f0;
    color: var(--color-text, #2d3748);
}

.btn-prev:hover:not(:disabled) {
    background: #cbd5e0;
    transform: translateX(-3px);
}

.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-complete {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-complete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.btn-next {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.3);
}

.btn-next:hover {
    transform: translateX(3px);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.4);
}

/* Controles del rosario */
.rosario-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-control:hover {
    border-color: var(--rosario-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Preview de misterios */
.mysteries-preview {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.mysteries-preview h4 {
    font-family: var(--font-heading);
    color: var(--color-primary, #1e3a5f);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.mysteries-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mystery-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--rosario-cream);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid transparent;
}

.mystery-item:hover {
    background: white;
    border-color: var(--rosario-gold);
    transform: translateX(5px);
}

.mystery-item.current {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 58, 95, 0.3);
}

.mystery-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--rosario-gold);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    font-size: 0.9rem;
}

.mystery-item.current .mystery-number {
    background: var(--rosario-gold-light);
    color: var(--color-primary);
}

.mystery-name {
    font-weight: 600;
    color: var(--color-text, #2d3748);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--color-text-light, #4a5568);
    transition: color 0.3s;
}

.close:hover {
    color: var(--color-primary);
}

.meditation-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text, #2d3748);
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--rosario-cream);
    border-radius: 16px;
    font-style: italic;
}

.meditation-timer {
    text-align: center;
    margin-top: 2rem;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: 'Courier New', monospace;
    margin-bottom: 1rem;
}

.btn-timer {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--rosario-purple) 0%, #7B68EE 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-timer:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 51, 153, 0.4);
}

.btn-timer:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Modal de completado */
.completion-modal {
    text-align: center;
}

.completion-modal h2 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.completion-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat {
    background: var(--rosario-cream);
    padding: 1.5rem;
    border-radius: 16px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--color-text-light, #4a5568);
}

.btn-primary {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, var(--rosario-gold) 0%, var(--rosario-gold-light) 100%);
    color: var(--color-primary-dark);
    border: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* Notificaciones */
.rosario-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10001;
    opacity: 0;
    transition: all 0.3s ease;
}

.rosario-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Partículas y efectos */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--rosario-gold);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float-particle {
    0%, 100% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-100px) scale(1);
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confetti-fall 3s ease-out forwards;
    pointer-events: none;
    z-index: 10002;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .rosario-container {
        padding: 1rem;
    }
    
    .rosario-header {
        flex-direction: column;
        text-align: center;
    }
    
    .mystery-select {
        min-width: unset;
        width: 100%;
    }
    
    .mystery-title {
        font-size: 1.5rem;
    }
    
    .prayer-card {
        padding: 1.5rem;
    }
    
    .prayer-text-content {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .prayer-controls {
        flex-direction: column;
    }
    
    .prayer-controls button {
        width: 100%;
    }
    
    .rosario-controls {
        flex-direction: column;
    }
    
    .btn-control {
        width: 100%;
        justify-content: center;
    }
    
    .completion-stats {
        grid-template-columns: 1fr;
    }
    
    #rosary-svg {
        max-width: 300px;
    }
}

/* Modo oscuro (futuro) */
@media (prefers-color-scheme: dark) {
    #rosario-app {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .mystery-card,
    .prayer-card,
    .mysteries-preview,
    .rosario-header {
        background: #0f0f23;
        color: white;
    }
    
    .prayer-text-content {
        background: #1a1a2e;
        color: #e0e0e0;
    }
}
