* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg, #9ca3af 0%, #1e3a8a 100%);
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
}

.logo-icon {
    width: 24px;
    height: 24px;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
}

.header-controls {
    display: flex;
    gap: 12px;
}

.icon-button {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* Dropdown */
.dropdown-container {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    margin-top: 8px;
}

.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #374151;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 4px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    position: relative;
}

.ready-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    margin-bottom: 40px;
    text-align: center;
}

/* Main Breathing Button */
.breathing-button-container {
    width: 65vw;
    height: 65vw;
    max-width: 400px;
    max-height: 400px;
    margin-bottom: 40px;
}

.breathing-button {
    width: 100%;
    height: 100%;
    border: none;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 24px;
    color: white;
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.breathing-button:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4);
}

.breathing-button:active,
.breathing-button.pressed {
    transform: scale(0.98);
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.6);
}

.breathing-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 24px;
    transition: opacity 0.3s ease;
}

.breathing-button.pressed::before {
    opacity: 0.8;
}

.button-text {
    position: relative;
    z-index: 1;
}

/* Paused State Visual Cue */
body.session-active.paused .breathing-button {
    filter: grayscale(40%) brightness(0.9);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
}
body.session-active.paused .button-text::after {
    content: ' (Paused)';
    font-size: 14px;
    font-weight: 400;
    opacity: 0.8;
    display: block;
    margin-top: 4px;
}

/* Controls Container */
.controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    width: 100%;
    max-width: 300px;
}

/* Start Button */
.start-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    cursor: pointer;
    transition: all 0.2s ease;
}

.start-button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Pause Button */
.pause-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 25px;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pause-button:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Cancel Button */
.cancel-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-button:hover {
    background: rgba(220, 38, 38, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Exercise Info */
.exercise-info {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    text-align: center;
    margin-top: 20px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 20px;
}

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

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.close-button {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-button:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-content {
    padding: 24px;
}

/* Settings */
.setting-group {
    margin-bottom: 24px;
}

.setting-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    margin-bottom: 8px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #8b5cf6;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    appearance: none;
    -webkit-appearance: none;
}

.volume-value {
    font-size: 12px;
    color: #6b7280;
}

.create-exercise-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: #8b5cf6;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.create-exercise-btn:hover {
    background: #7c3aed;
    transform: translateY(-1px);
}

.settings-exercise-list h3 {
    margin: 0 0 8px 0;
}

.custom-exercises .settings-exercise-item .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(243,244,246,1);
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-exercises .settings-exercise-item .icon-button:hover {
    background: rgba(241,243,245,1);
    transform: translateY(-1px);
}

/* Modal tweaks for delete dialog */
.modal .confirm-cancel-btn {
    background: #ef4444;
}
.modal .keep-going-btn {
    background: #10b981;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.cycle-input {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.cycle-input h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.cycle-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.save-button {
    width: 100%;
    padding: 12px;
    background: #10b981;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-button:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Confirmation Buttons */
.confirm-cancel-btn,
.keep-going-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    max-width: 150px;
}

.confirm-cancel-btn {
    background: #ef4444;
    color: white;
}

.confirm-cancel-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.keep-going-btn {
    background: #10b981;
    color: white;
}

.keep-going-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Session States */
.session-active .ready-text {
    display: none;
}

.session-active .start-button {
    display: none;
}

.timer-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timer-display.visible {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .breathing-button-container {
        width: 70vw;
        height: 70vw;
    }
    
    .modal {
        margin: 20px;
    }
    
    .header {
        padding: 16px 20px;
    }
    
    .main-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .breathing-button-container {
        width: 75vw;
        height: 75vw;
    }
    
    .breathing-button {
        font-size: 20px;
        border-radius: 20px;
    }
    
    .cycle-row {
        grid-template-columns: 1fr;
    }
}

/* Settings Exercise List Items */
.settings-exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.settings-exercise-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-exercise-title {
    font-weight: 600;
    color: #111827;
}

.settings-exercise-meta {
    font-size: 12px;
    color: #6b7280;
}

.settings-exercise-actions {
    display: flex;
    gap: 8px;
}

.settings-exercise-actions .icon-button {
    padding: 6px;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(243,244,246,1);
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.settings-exercise-actions .icon-button:hover {
    background: rgba(241,243,245,1);
    transform: translateY(-1px);
}
