/* ===================================
   TJ Aktiviteter - Main Stylesheet
   =================================== */

/* CSS Variables - Design Tokens */
:root {
    --primary: #ff8c69;
    --primary-dark: #e07a60;
    --secondary: #9db39c;
    --accent: #7ba3a0;
    --warm-gray: #f8f6f3;
    --warm-white: #fefdfb;
}

/* Base Styles */
body {
    background: linear-gradient(135deg, #fdfcfa 0%, #f9f7f4 100%);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
}

/* Smooth page transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Page fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body > div,
body > main {
    animation: fadeIn 0.4s ease-out;
}

/* Card Components */
.modern-card {
    background: var(--warm-white);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.modern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 140, 105, 0.05), transparent);
    transition: left 0.5s ease;
}

/* .modern-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    border-color: rgba(255, 140, 105, 0.2);
}

.modern-card:hover::before {
    left: 100%;
} */

/* Button Components */
.modern-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(255, 140, 105, 0.25);
    border: none;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

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

.modern-btn:active::after {
    width: 300px;
    height: 300px;
}

.modern-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 140, 105, 0.4);
}

.modern-btn:active:not(:disabled) {
    transform: translateY(0);
}

.modern-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modern-btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, #8ba68a 100%);
    box-shadow: 0 2px 4px rgba(157, 179, 156, 0.25);
}

.modern-btn-secondary:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(157, 179, 156, 0.4);
}

.modern-btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #6b9896 100%);
    box-shadow: 0 2px 4px rgba(123, 163, 160, 0.25);
}

.modern-btn-accent:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(123, 163, 160, 0.4);
}

.modern-btn-purple {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5bb0 100%);
    box-shadow: 0 2px 4px rgba(167, 139, 250, 0.25);
}

.modern-btn-purple:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.4);
}

.modern-btn-red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.25);
}

.modern-btn-red:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Form Input Components */
.modern-input {
    background: var(--warm-white);
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.modern-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 140, 105, 0.1);
}

.modern-textarea {
    background: var(--warm-white);
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-size: 16px;
    resize: vertical;
}

.modern-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 140, 105, 0.1);
}

/* Checkbox Components */
.checkbox-custom {
    width: 20px;
    height: 20px;
    background: var(--warm-white);
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.checkbox-custom:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-custom:focus {
    box-shadow: 0 0 0 4px rgba(255, 140, 105, 0.1);
}

/* Typography */
.title-gradient {
    background: linear-gradient(135deg, #374151 0%, #6b7280 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header {
    color: #374151;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header .emoji {
    font-size: 1.2em;
}

/* Range Slider */
.modern-range {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(90deg, #e5e7eb 0%, var(--primary) 100%);
    border-radius: 3px;
    outline: none;
}

.modern-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 3px solid var(--primary);
}

.modern-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 3px solid var(--primary);
}

/* Flash Messages */
.flash-message {
    border-radius: 12px;
    border: 1px solid transparent;
}

.flash-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-color: rgba(34, 197, 94, 0.2);
    color: #15803d;
}

.flash-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: rgba(245, 158, 11, 0.2);
    color: #b45309;
}

.flash-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

/* Category Cards */
.category-card {
    background: var(--warm-white);
    border-radius: 16px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

/* Legend & Chart */
.legend-item {
    background: white;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.legend-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chart-container {
    background: var(--warm-gray);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Notifications */
.notification {
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

/* Loading Animations */
.loading-animation {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Utility: Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* Accessibility: Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Cool Enhancements */

/* Glassmorphism effect */
.glass {
    background: rgba(254, 253, 251, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

/* Skeleton loading animation */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

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

/* Success checkmark animation */
.success-checkmark {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #22c55e;
    position: relative;
    animation: scaleIn 0.3s ease-out;
}

.success-checkmark::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: checkmark 0.3s ease-out 0.1s backwards;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes checkmark {
    0% {
        height: 0;
    }
    100% {
        height: 12px;
    }
}

/* Pulse animation for notifications */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Subtle shine effect on hover */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
}

.shine:hover::before {
    left: 100%;
}

/* Floating animation for icons/emojis */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float {
    animation: float 3s ease-in-out infinite;
}

/* Smooth slide-in from bottom */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

/* Stagger animation for lists */
.stagger-item {
    animation: slideUp 0.4s ease-out backwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }

/* Gradient text animation */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-animate {
    background: linear-gradient(45deg, var(--primary), var(--accent), var(--secondary), var(--primary));
    background-size: 300% 300%;
    animation: gradient-shift 3s ease infinite;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Bounce on click */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.bounce-on-click:active {
    animation: bounce 0.3s ease;
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .modern-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .modern-btn,
    nav,
    .no-print {
        display: none;
    }
}
