/* ============================================
   Stille Momente — Achtsamkeits-App
   Warm, sunny, modern design
   ============================================ */

:root {
    --sun-50: #fffbf0;
    --sun-100: #fef5e0;
    --sun-200: #fce8b8;
    --sun-300: #f8d98a;
    --sun-400: #f4c456;
    --sun-500: #e8a832;
    --warm-50: #fdf6f0;
    --warm-100: #f8e9d2;
    --warm-200: #f0d4ad;
    --warm-300: #e4b887;
    --ocean-100: #e8f4f8;
    --ocean-200: #b8dce8;
    --ocean-300: #7bbdd4;
    --ocean-400: #4a9ab8;
    --sage-100: #ecf0e8;
    --sage-200: #c8d8bc;
    --sage-300: #94b07c;
    --text-primary: #3a3028;
    --text-secondary: #6b5e52;
    --text-light: #9a8d82;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(58, 48, 40, 0.06);
    --shadow-md: 0 4px 20px rgba(58, 48, 40, 0.1);
    --shadow-lg: 0 8px 40px rgba(58, 48, 40, 0.15);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(170deg, var(--sun-50) 0%, var(--warm-50) 50%, var(--ocean-100) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Splash Screen */
.splash {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(150deg, var(--sun-100) 0%, var(--warm-100) 40%, var(--ocean-100) 100%);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.splash.fade-out {
    opacity: 0;
    transform: scale(1.1);
    pointer-events: none;
}

.splash-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.splash-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.splash-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.splash-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* App Container */
.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 1.25rem 2rem;
    min-height: 100vh;
    min-height: 100dvh;
}

.hidden {
    display: none !important;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0 0.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 0 -1.25rem;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.greeting {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.header-nav {
    display: flex;
    gap: 0.25rem;
}

.nav-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn.active {
    color: var(--sun-500);
    background: var(--sun-100);
}

.nav-btn:hover {
    color: var(--sun-500);
}

/* Categories */
.categories {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}

.category-btn {
    padding: 0.6rem 0.6rem;
    border: 1.5px solid var(--warm-200);
    background: var(--white);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-btn.active {
    background: var(--sun-400);
    border-color: var(--sun-400);
    color: var(--white);
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(244, 196, 86, 0.3);
}

.category-btn:hover:not(.active) {
    border-color: var(--sun-300);
    color: var(--text-primary);
}

/* Cards */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding-bottom: 1rem;
}

.card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card:active {
    transform: scale(0.98);
}

.card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: var(--warm-100);
    transition: transform 0.5s ease;
}

.card:hover .card-image {
    transform: scale(1.03);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(30, 24, 18, 0.7) 0%, rgba(30, 24, 18, 0.1) 50%, transparent 100%);
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: var(--white);
}

.card-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 100px;
    margin-bottom: 0.5rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    line-height: 1.2;
}

.card-duration {
    font-size: 0.8rem;
    opacity: 0.85;
    font-weight: 300;
}

.card-favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.card-favorite-btn.is-favorite {
    background: rgba(232, 84, 84, 0.8);
}

.card-favorite-btn.is-favorite svg {
    fill: white;
}

.card-favorite-btn:hover {
    transform: scale(1.1);
}

/* Daily Quote */
.daily-quote {
    margin-top: 1.5rem;
    padding: 2rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border: 1px solid var(--sun-100);
}

.quote-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.quote-author {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

/* View Title */
.view-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    padding: 1rem 0;
    color: var(--text-primary);
}

.view {
    display: none;
}

.view.active {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-light);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-hint {
    font-size: 0.85rem;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Settings */
.settings-group {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 0.5rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--sun-50);
    font-size: 0.95rem;
}

.setting-item:last-child {
    border-bottom: none;
}

.toggle {
    position: relative;
    width: 52px;
    height: 28px;
    display: inline-block;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--warm-200);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toggle input:checked + .toggle-slider {
    background: var(--sun-400);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.time-input {
    padding: 0.4rem 0.75rem;
    border: 1.5px solid var(--warm-200);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--sun-50);
}

.settings-info {
    padding: 0.75rem 0;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.settings-version {
    padding-bottom: 1rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 24, 18, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    max-height: 92dvh;
    background: var(--white);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow-y: auto;
    animation: slideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-image {
    width: 100%;
    height: 260px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, var(--white), transparent);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    z-index: 2;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.1);
}

.modal-body {
    padding: 0.5rem 1.5rem 2rem;
}

.modal-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.85rem;
    background: var(--sun-100);
    color: var(--sun-500);
    border-radius: 100px;
    margin-bottom: 0.75rem;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.modal-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-steps {
    margin-bottom: 1.5rem;
}

.step {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--sun-50);
}

.step:last-child {
    border-bottom: none;
}

.step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sun-100);
    color: var(--sun-500);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 500;
}

.step-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    padding-top: 0.2rem;
}

/* Meditation Player */
.meditation-player {
    background: var(--sun-50);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--sun-100);
}

.meditation-heading {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
}

.voice-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.voice-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.5rem;
    border: 1.5px solid var(--warm-200);
    background: var(--white);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.voice-btn.active {
    background: var(--sun-400);
    border-color: var(--sun-400);
    color: var(--white);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(244, 196, 86, 0.3);
}

.meditation-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.meditation-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ambient-slider {
    width: 55%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--warm-200);
    border-radius: 2px;
    outline: none;
}

.ambient-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--sun-400);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(244, 196, 86, 0.4);
}

.speed-selector {
    display: flex;
    gap: 0.3rem;
}

.speed-btn {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--warm-200);
    background: var(--white);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.speed-btn.active {
    background: var(--sun-100);
    border-color: var(--sun-300);
    color: var(--sun-500);
    font-weight: 500;
}

.meditation-progress {
    margin-bottom: 1rem;
    display: none;
}

.meditation-progress.visible {
    display: block;
}

.progress-bar {
    height: 4px;
    background: var(--warm-200);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sun-400), var(--sun-500));
    border-radius: 2px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    display: block;
}

.meditation-controls {
    display: flex;
    gap: 0.5rem;
}

.meditation-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.meditation-btn.primary {
    background: var(--sun-400);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(244, 196, 86, 0.3);
}

.meditation-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(244, 196, 86, 0.4);
}

.meditation-btn.secondary {
    background: var(--warm-100);
    color: var(--text-secondary);
}

.meditation-btn.secondary:hover {
    background: var(--warm-200);
}

.voice-warning {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fef3e0;
    border: 1px solid #f0c060;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: #8a6020;
    text-align: center;
}

/* Active step highlight during meditation */
.step.meditation-active {
    background: var(--sun-50);
    border-left: 3px solid var(--sun-400);
    padding-left: calc(1rem - 3px);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: all 0.4s ease;
}

.step.meditation-active .step-number {
    background: var(--sun-400);
    color: var(--white);
}

/* Timer */
.modal-timer {
    text-align: center;
    padding: 1.5rem;
    background: var(--sun-50);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.timer-display {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.timer-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.timer-btn {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--sun-400);
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(244, 196, 86, 0.3);
}

.timer-btn:last-child {
    width: 44px;
    height: 44px;
    background: var(--warm-200);
    color: var(--text-secondary);
    box-shadow: none;
}

.timer-btn:hover {
    transform: scale(1.05);
}

.timer-btn:active {
    transform: scale(0.95);
}

/* Modal Favorite */
.modal-favorite {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border: 1.5px solid var(--warm-200);
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-favorite:hover {
    border-color: var(--sun-300);
    background: var(--sun-50);
}

.modal-favorite.is-favorite {
    border-color: #e85454;
    background: #fef0f0;
    color: #e85454;
}

.modal-favorite.is-favorite svg {
    fill: #e85454;
    stroke: #e85454;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive */
@media (min-width: 481px) {
    .app {
        padding-top: 1rem;
    }
}

/* Safe area padding for notched phones */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(1rem + env(safe-area-inset-top));
    }
    .modal-content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
