body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: linear-gradient(0deg, rgba(9,9,121,1) 0%, rgba(1,190,241,1) 25%, rgba(0,212,255,1) 44%, rgba(2,0,36,0.8491771708683473) 96%, rgba(2,0,36,1) 100%);
    font-family: Arial, sans-serif;
}

/* Logo */
#logo {
    position: fixed;
    top: 20px;
    left: 20px;
    height: 40px;
    width: auto;
    z-index: 1000;
    opacity: 0.95;
    transition: opacity 0.3s ease;
}

#logo:hover {
    opacity: 1;
}

#container {
    display: flex;
    flex-direction: column;
    position: relative;
    justify-content: center;
    align-items: center;
    width: 23rem;
    height: 23rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgb(71, 52, 61) 47%, rgba(148,187,233,1) 100%);
    box-shadow: 
        0 0 40px rgba(255, 255, 255, 0.15),
        0 0 80px rgba(22, 12, 114, 0.8),
        inset 0 0 40px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

#state {
    position: absolute;
    top: 0;
    transform: translateY(-180%);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    letter-spacing: 0.05em;
    text-transform: capitalize;
    color: rgba(255, 255, 255, 0.95);
    transition: opacity 0.8s ease-in-out, transform 0.5s ease;
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2);
}

/* Animación de aparición del texto */
#state.phase-change {
    animation: text-appear 0.8s ease-out;
}

@keyframes text-appear {
    0% {
        opacity: 0;
        transform: translateY(-180%) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(-180%) translateY(0);
    }
}

#inner-circle {
    position: absolute;
    width: 15%;
    height: 15%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 100%);
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.6),
        0 0 40px rgba(255, 255, 255, 0.4),
        0 0 60px rgba(255, 255, 255, 0.2),
        inset 0 0 20px rgba(255, 255, 255, 0.3);
    animation: gentle-pulse 4s ease-in-out infinite;
}

/* Pulso sutil que acompaña la respiración */
@keyframes gentle-pulse {
    0%, 100% {
        opacity: 0.9;
    }
    50% {
        opacity: 1;
    }
}

#timeState {
    position: absolute;
    bottom: 0;
    transform: translateY(180%);
    font-size: 3rem;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 255, 255, 0.2);
    transition: transform 0.3s ease;
}

/* Efecto de pulso en cada segundo */
#timeState.tick {
    animation: timer-tick 0.3s ease;
}

@keyframes timer-tick {
    0%, 100% {
        transform: translateY(180%) scale(1);
    }
    50% {
        transform: translateY(180%) scale(1.05);
    }
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.app-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.app-footer a {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 500;
}

/* SweetAlert Custom Styling */
.swal2-container {
    z-index: 9999 !important;
}

.swal2-popup {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 40px rgba(22, 12, 114, 0.4);
}

.swal2-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    font-weight: 400;
    letter-spacing: 0.03em;
}

.swal2-html-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    font-weight: 300;
}

.swal2-confirm, .swal2-cancel {
    border-radius: 8px;
    font-weight: 500;
    padding: 10px 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.swal2-confirm:hover, .swal2-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Botones flotantes */
#floating-btn,
#custom-times-btn,
#audio-btn {
    position: fixed;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Posicionamiento de botones flotantes - Desktop (vertical) */
#floating-btn {
    top: 20px;
    right: 20px;
}

#custom-times-btn {
    top: 90px;
    right: 20px;
}

#audio-btn {
    top: 160px;
    right: 20px;
}

#floating-btn:hover,
#custom-times-btn:hover,
#audio-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#floating-btn svg,
#custom-times-btn svg,
#audio-btn svg {
    color: #ffffff;
}

/* Modales */
#breath-selector-modal,
#custom-times-modal,
#audio-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#breath-selector-modal.active,
#custom-times-modal.active,
#audio-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, rgba(71, 52, 61, 0.98) 0%, rgba(22, 12, 114, 0.98) 100%);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    transition: transform 0.2s ease;
    will-change: transform;
}

#breath-selector-modal.active .modal-content,
#custom-times-modal.active .modal-content,
#audio-modal.active .modal-content {
    transform: scale(1);
}

/* Botón X para cerrar modal (superior derecha) */
.close-modal-x {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #ffffff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-modal-x:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Botones de cierre en la parte inferior (mobile) */
.modal-close-btn {
    width: 100%;
    padding: 0.8rem;
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgb(220, 38, 38);
    border-radius: 8px;
    color: rgb(220, 38, 38);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    display: none; /* Oculto por defecto en desktop */
}

.modal-close-btn:hover {
    background: rgba(220, 38, 38, 0.3);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
}

.modal-content h2 {
    color: #ffffff;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.breath-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.breath-card {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.breath-card:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.breath-card h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

.breath-pattern {
    color: #00d4ff;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.breath-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Panel de configuración */
#settings-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: 350px;
    background: rgba(71, 52, 61, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem;
    z-index: 900;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-height: 70vh;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h3 {
    color: #ffffff;
    font-size: 1rem;
    margin: 0 0 1rem 0;
}

/* Audio Player */
#audio-input {
    display: block;
    margin-bottom: 0.8rem;
    color: #ffffff;
    font-size: 0.85rem;
}

#audio-file-name {
    color: #00d4ff;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    word-break: break-word;
}

.audio-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.audio-controls button {
    flex: 1;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.audio-controls button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.audio-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.volume-control label {
    color: #ffffff;
    font-size: 0.85rem;
    min-width: 60px;
}

.volume-control input {
    flex: 1;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    cursor: pointer;
}

.volume-control input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
}

.volume-control input::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00d4ff;
    cursor: pointer;
    border: none;
}

/* Custom Times */
.time-input-group {
    margin-bottom: 0.8rem;
}

.time-input-group label {
    display: block;
    color: #ffffff;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.time-input-group input {
    width: 100%;
    padding: 0.6rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #00d4ff;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.time-input-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

#apply-custom-btn {
    width: 100%;
    padding: 0.8rem;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid #00d4ff;
    border-radius: 8px;
    color: #00d4ff;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

#apply-custom-btn:hover:not(:disabled) {
    background: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

#apply-custom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Secciones del modal de custom times */
.custom-times-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.custom-times-section h3 {
    color: #00d4ff;
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

/* Lista de respiraciones guardadas */
#saved-breaths-list {
    max-height: 300px;
    overflow-y: auto;
}

.saved-breath-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.saved-breath-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
}

.breath-info h4 {
    color: #ffffff;
    font-size: 0.9rem;
    margin: 0 0 0.3rem 0;
}

.breath-info p {
    color: #aaa;
    font-size: 0.75rem;
    margin: 0;
}

.breath-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-load-breath,
.btn-delete-breath {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid;
}

.btn-load-breath {
    background: rgba(0, 212, 255, 0.2);
    border-color: #00d4ff;
    color: #00d4ff;
}

.btn-load-breath:hover:not(:disabled) {
    background: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.btn-delete-breath {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgb(220, 38, 38);
    color: rgb(220, 38, 38);
}

.btn-delete-breath:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.3);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
}

.btn-load-breath:disabled,
.btn-delete-breath:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#apply-custom-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design - Botones y Modales */
@media (max-width: 768px) {
    
    #floating-btn,
    #custom-times-btn,
    #audio-btn {
        display: none; /* Ocultar botones individuales en mobile */
    }
}

/* Botón hamburguesa (solo mobile) */
#hamburger-btn {
    display: none; /* Oculto por defecto en desktop */
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

#hamburger-btn svg {
    color: #ffffff;
}

/* Panel lateral mobile */
#mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: linear-gradient(180deg, rgba(71, 52, 61, 0.98) 0%, rgba(22, 12, 114, 0.98) 100%);
    backdrop-filter: blur(10px);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 3001;
    transition: right 0.3s ease;
    display: none; /* Oculto en desktop */
}

#mobile-menu-panel.active {
    right: 0;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-header h3 {
    color: #ffffff;
    margin: 0;
    font-size: 1.3rem;
}

#close-menu-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #ffffff;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#close-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.menu-options {
    padding: 1rem 0;
}

.menu-option {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: transparent;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #00d4ff;
}

.menu-option svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.menu-option span {
    font-size: 1rem;
    text-align: left;
}

/* Overlay del menú */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none; /* Oculto en desktop */
}

#menu-overlay.active {
    opacity: 1;
    visibility: visible;
}


/* Responsive Design - Small Mobile */
@media (max-width: 360px) {
    #container {
        width: 10rem;
        height: 10rem;
        box-shadow: 1px 1px 12px 6px rgb(22, 12, 114);
    }

    #state {
        font-size: 1.2rem;
    }

    #inner-circle {
        width: 12vh;
        height: 12vh;
    }

    #timeState {
        font-size: 1.5rem;
    }

    #floating-btn {
        width: 45px;
        height: 45px;
    }

    #logo {
        height: 26px;
    }

    .breath-card h3 {
        font-size: 1rem;
    }
}

/* Responsive Design - Small Mobile */
@media (max-width: 480px) {
    #hamburger-btn {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }

    #mobile-menu-panel {
        width: 85vw;
        right: -85vw;
    }

    .menu-header h3 {
        font-size: 1.1rem;
    }

    .menu-option {
        padding: 1rem 1.2rem;
    }

    .menu-option span {
        font-size: 0.95rem;
    }

    #settings-panel {
        max-width: 100vw;
        width: calc(100% - 30px);
        bottom: 10px;
        right: 15px;
        left: 15px;
        max-height: 50vh;
        padding: 1rem;
    }

    .settings-section {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .settings-section h3 {
        font-size: 0.9rem;
        margin-bottom: 0.8rem;
    }

    .audio-controls button {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .time-input-group input {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    #apply-custom-btn {
        padding: 0.6rem;
        font-size: 0.85rem;
    }

    #container {
        width: 10rem;
        height: 10rem;
        box-shadow: 2px 2px 15px 8px rgb(22, 12, 114);
    }

    #state {
        font-size: 1.5rem;
    }

    #inner-circle {
        width: 15vh;
        height: 15vh;
    }

    #timeState {
        font-size: 2rem;
    }

    #floating-btn {
        width: 50px;
        height: 50px;
        top: 15px;
        right: 15px;
    }

    #logo {
        height: 30px;
        top: 15px;
        left: 15px;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 1.3rem;
    }

    .breath-card {
        padding: 1.2rem;
    }

    .breath-pattern {
        font-size: 1.3rem;
    }
}

/* Responsive Design - Mostrar hamburguesa, ocultar botones individuales - Settings Panel */
@media (max-width: 768px) {
    /* Ocultar botones individuales en mobile */
    #floating-btn,
    #custom-times-btn,
    #audio-btn {
        display: none;
    }

    /* Mostrar menú hamburguesa */
    #hamburger-btn {
        display: flex;
    }

    #mobile-menu-panel,
    #menu-overlay {
        display: block;
    }

    #container {
        width: 18rem;
        height: 18rem;
        box-shadow: 2px 2px 20px 10px rgb(22, 12, 114);
    }

    #state {
        font-size: 2rem;
    }

    #inner-circle {
        width: 18vh;
        height: 18vh;
    }

    #timeState {
        font-size: 2.5rem;
    }

    .breath-cards {
        grid-template-columns: 1fr;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    #logo {
        height: 35px;
    }

    #settings-panel {
        max-width: 90vw;
        bottom: 15px;
        right: 15px;
        padding: 1.2rem;
        max-height: 60vh;
    }

    .settings-section h3 {
        font-size: 0.95rem;
    }

    .time-input-group label {
        font-size: 0.8rem;
    }

    #apply-custom-btn {
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    .close-modal-x {
        display: none; /* Ocultar X en mobile */
    }

    .modal-close-btn {
        display: block; /* Mostrar botón inferior en mobile */
    }
}
