/**
 * Meine Routine PWA Styles
 */

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Disable text selection for touch */
.no-select {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Routine card animations */
.routine-card {
    transition: all 0.3s ease;
}

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

/* Checkbox button animation */
.routine-card button:first-child {
    transition: all 0.2s ease;
}

.routine-card button:first-child:active {
    transform: scale(0.9);
}

/* Bottom navigation */
.bottom-nav {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Nav button active state */
.nav-btn.active {
    color: #3B82F6;
}

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

/* Modal animation */
.fixed.bg-black > div {
    animation: slideUp 0.3s ease-out;
}

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

/* Progress bar animation */
#progressBar {
    transition: width 0.5s ease-out;
}

/* Skeleton loading animation */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e8e8e8 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Pull to refresh */
.pull-indicator {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    transition: top 0.3s ease;
    z-index: 1000;
}

.pull-indicator.visible {
    top: 70px;
}

/* Toast animations */
.toast-enter {
    animation: toastEnter 0.3s ease-out;
}

.toast-exit {
    animation: toastExit 0.3s ease-out forwards;
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastExit {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Mood/Energy buttons */
.mood-btn, .energy-btn {
    transition: all 0.2s ease;
}

.mood-btn:active, .energy-btn:active {
    transform: scale(0.9);
}

/* Install prompt */
.install-prompt {
    animation: slideUp 0.3s ease-out;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ripple effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
}

/* Category colors */
.category-health { color: #10B981; }
.category-business { color: #3B82F6; }
.category-personal { color: #8B5CF6; }
.category-breaks { color: #F59E0B; }

/* Status indicators */
.status-pending { background-color: #FEF3C7; color: #92400E; }
.status-completed { background-color: #D1FAE5; color: #065F46; }
.status-skipped { background-color: #FEE2E2; color: #991B1B; }

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari bottom padding fix */
    .bottom-nav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }

    /* iOS bounce scroll fix */
    body {
        overscroll-behavior-y: none;
    }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here */
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
