/* Gangetabell Trener - Stiler */

/* Animasjoner */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0, -30px, 0); }
    70% { transform: translate3d(0, -15px, 0); }
    90% { transform: translate3d(0, -4px, 0); }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

@keyframes rainbow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes confettiFall {
    0% { transform: translateY(-20vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Animasjonsklasser */
.bounce-animation { animation: bounce 1s ease-in-out; }
.pulse-animation { animation: pulse 0.5s ease-in-out; }
.shake-animation { animation: shake 0.5s ease-in-out; }
.sparkle { animation: sparkle 2s ease-in-out infinite; }
.float { animation: float 3s ease-in-out infinite; }
.power-up-active { 
    animation: pulse 0.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

/* Bakgrunner */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-space { 
    background: linear-gradient(135deg, #0c1445 0%, #1a237e 50%, #000051 100%); 
}

.theme-jungle { 
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #4caf50 100%); 
}

.theme-ocean { 
    background: linear-gradient(135deg, #01579b 0%, #0277bd 50%, #0288d1 100%); 
}

/* Regnbue tekst */
.rainbow-text {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 3s ease-in-out infinite;
}

/* Konfetti */
.confetti {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 50;
}

.confetti-piece {
    position: absolute;
    font-size: 20px;
    animation: confettiFall 1.5s linear forwards;
}

/* Responsive design */
@media (max-width: 1024px) {
    /* Nettbrett-støtte */
    .text-6xl { font-size: 3.5rem; }
    .text-4xl { font-size: 2.25rem; }
    .text-3xl { font-size: 1.75rem; }
    .text-2xl { font-size: 1.5rem; }
    .text-xl { font-size: 1.25rem; }
    .text-lg { font-size: 1.125rem; }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
    .p-8 { padding: 1.5rem; }
    .p-6 { padding: 1rem; }
    .py-6 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
    .px-12 { padding-left: 2.5rem; padding-right: 2.5rem; }
}

@media (max-width: 768px) {
    .text-6xl { font-size: 3rem; }
    .text-4xl { font-size: 2rem; }
    .text-3xl { font-size: 1.5rem; }
    .text-2xl { font-size: 1.25rem; }
    .text-xl { font-size: 1.125rem; }
    .text-lg { font-size: 1rem; }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-5 { grid-template-columns: repeat(3, 1fr); }
    .p-8 { padding: 1rem; }
    .p-6 { padding: 0.75rem; }
    .py-6 { padding-top: 1rem; padding-bottom: 1rem; }
    .px-12 { padding-left: 2rem; padding-right: 2rem; }
}

@media (max-width: 480px) {
    .text-6xl { font-size: 2.5rem; }
    .text-4xl { font-size: 1.75rem; }
    .text-3xl { font-size: 1.25rem; }
    .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-cols-5 { grid-template-columns: repeat(2, 1fr); }
    .p-4 { padding: 0.5rem; }
    .py-4 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
    .px-8 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* Forbedret touch targets for mobil og nettbrett */
@media (max-width: 1024px) {
    button {
        min-height: 48px;
        min-width: 48px;
        touch-action: manipulation;
    }
    
    .touch-target {
        min-height: 52px;
        min-width: 52px;
        touch-action: manipulation;
    }
    
    /* Forbedre touch-feedback */
    button:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    input {
        min-height: 48px;
        font-size: 16px; /* Forhindrer zoom på iOS */
    }
}

@media (max-width: 768px) {
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .touch-target {
        min-height: 48px;
        min-width: 48px;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Forbedret accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Hover states for touch devices */
@media (hover: hover) {
    .hover-lift:hover {
        transform: translateY(-2px);
    }
}

/* Smooth transitions */
* {
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Better button states */
button:active {
    transform: scale(0.98);
}

/* Improved backdrop blur support */
@supports (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        backdrop-filter: blur(4px);
    }
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(10px)) {
    .backdrop-blur-sm {
        background-color: rgba(255, 255, 255, 0.1);
    }
}
