/* ===================================
   GRUNDLÆGGENDE STYLING & RESET
   =================================== */

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

body {
    font-family: 'Poppins', sans-serif;
    overflow:  hidden;
    height: 100vh;
    width: 100vw;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
    position: fixed;
    touch-action: none;
}

/* ===================================
   PRELOADER
   =================================== */

#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.5s ease-in-out 1.5s forwards;
}

#preloader .snowflake {
    font-size: 4rem;
    animation: spin 2s linear infinite;
}

#preloader p {
    color: white;
    margin-top: 1rem;
    font-size:  1.1rem;
    font-weight: 300;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

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

/* ===================================
   APP CONTAINER
   =================================== */

#app-container {
    width: 100%;
    height:  100vh;
    position: relative;
    overflow: hidden;
}

#swipe-container {
    width: 100%;
    height:  100%;
    position: relative;
}

/* ===================================
   PAGE STYLING
   =================================== */

.page {
    position: absolute;
    top: 0;
    left:  0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.35s ease;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    will-change: transform, opacity;
}

.page.active {
    opacity: 1;
    transform: translateY(0);
    z-index: 10;
}

.page.transitioning {
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.35s ease;
}

.page.exit-up {
    transform: translateY(-100%);
    opacity: 0;
}

.page.exit-down {
    transform: translateY(100%);
    opacity: 0;
}

.page.enter-up {
    transform: translateY(100%);
    opacity: 0;
}

.page.enter-down {
    transform: translateY(-100%);
    opacity: 0;
}

/* ===================================
   FORSIDE STYLING
   =================================== */

.front-page {
    background: linear-gradient(135deg, #134e5e 0%, #71b280 100%);
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Sne animationer */
.snow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height:  100%;
    overflow: hidden;
    pointer-events: none;
}

.snow-container .snowflake {
    position:  absolute;
    top: -10%;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.5rem;
    animation: fall linear infinite;
}

.snow-container .snowflake:nth-child(1) {
    left: 10%;
    animation-duration: 8s;
    animation-delay: 0s;
}

.snow-container .snowflake:nth-child(2) {
    left: 30%;
    animation-duration: 10s;
    animation-delay:  2s;
    font-size: 1.2rem;
}

.snow-container .snowflake:nth-child(3) {
    left: 50%;
    animation-duration: 12s;
    animation-delay: 4s;
    font-size: 1.8rem;
}

.snow-container .snowflake:nth-child(4) {
    left: 70%;
    animation-duration: 9s;
    animation-delay:  1s;
}

.snow-container .snowflake:nth-child(5) {
    left: 85%;
    animation-duration: 11s;
    animation-delay: 3s;
    font-size: 1.4rem;
}

.snow-container .snowflake:nth-child(6) {
    left: 95%;
    animation-duration: 13s;
    animation-delay: 5s;
}

.image-container {
    margin: 2rem auto;
    width: 100%;
    max-width: 200px !important;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(360deg);
    }
}

/* Forside indhold */
.front-content {
    z-index: 2;
    animation: fadeInUp 1s ease-out 0.5s both;
}

.christmas-title {
    font-family: 'Alex Brush', cursive;
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.subtitle {
    font-size: 1.2rem;
    color: #f0f0f0;
    margin-bottom: 4rem;
    font-weight: 300;
}

.christmas-decoration {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.ornament {
    font-size: 2.5rem;
    animation: bounce 2s ease-in-out infinite;
}

.ornament:nth-child(2) {
    animation-delay:  0.2s;
}

.ornament:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Swipe hint */
.swipe-hint {
    animation: fadeInUp 1s ease-out 1.5s both;
    margin-top: 4em;
}

.swipe-hint p {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.arrow-down {
    font-size: 2rem;
    animation: arrowBounce 1.5s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(15px); }
}

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

/* ===================================
   OPSKRIFTS SIDER
   =================================== */

.recipe-page {
    background: linear-gradient(135deg, #c31432 0%, #240b36 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
}

.recipe-header {
    text-align: center;
    margin-bottom: 1rem;
    margin: 1rem 2rem;
    animation: fadeInDown 0.6s ease-out;
    flex-shrink: 0;
}

.recipe-header h2 {
    font-family: 'Alex Brush', cursive;
    color: #fff;
    font-size: 1.8rem;
    margin-bottom: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Recipe image */
.recipe-image {
    width: 100%;
    max-width: 200px !important;
    margin: 0 auto 1rem;
    animation: fadeIn 0.8s ease-out 0.2s both;
    flex-shrink: 0;
}

.recipe-image img {
    width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

/* Opskrifts indhold */
.recipe-content {
    animation: fadeIn 0.8s ease-out 0.2s both;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.recipe-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.recipe-section h3 {
    color: #c31432;
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.recipe-section ul {
    padding-left: 1.5rem;
    color: #333;
    list-style: none;
}

.recipe-section li {
    margin-bottom: 0.6rem;
    line-height: 1.5;
    font-size: 0.95rem;
    position: relative;
    padding-left: 1.5rem;
}

.recipe-section li:before {
    content: "•";
    color: #c31432;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -0.2rem;
}

/* Program knap */
.recipe-section.program {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    text-align: center;
}

.recipe-section.program h3 {
    color: #fff;
}

.program-button {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    padding:  1rem 1.5rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight:  700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Tips sektion */
.recipe-section.tips {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-left: 4px solid #f5576c;
}

.recipe-section.tips h3 {
    color: #d84315;
}

.recipe-section.tips p {
    color: #5d4037;
    font-style: italic;
}

/* Ernæring sektion */
.recipe-section.nutrition {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.recipe-section.nutrition h3 {
    color: #0277bd;
}

.recipe-section.nutrition p {
    color: #01579b;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Swipe indikator */
.swipe-indicator {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    padding:  0.6rem 1.2rem;
    border-radius: 20px;
    font-size:  0.85rem;
    backdrop-filter: blur(10px);
    z-index: 100;
    animation: pulse 2s ease-in-out infinite;
    pointer-events: none;
}

/* ===================================
   SIDE INDIKATOR (PRIKKER)
   =================================== */

#page-indicator {
    position: fixed;
    top: 30px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.indicator-dot.active {
    background: #fff;
    transform: scale(1.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
    border-color: #fff;
}

/* ===================================
   ANIMATIONS
   =================================== */

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

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

/* ===================================
   RESPONSIV DESIGN
   =================================== */

/* iPhone SE og mindre */
@media (max-width: 375px) {
    .christmas-title {
        font-size: 2rem;
    }
    
    .image-container {
        max-width: 200px;
    }
    
    .recipe-header h2 {
        font-size: 2rem;
        margin-bottom: 0;
    }
    
    .recipe-image {
        max-width: 200px;
        margin-bottom: 0.8rem;
    }
    
    .recipe-image img {
        max-height: 240px;
    }
    
    .recipe-section {
        padding: 1rem;
    }
    
    .recipe-section h3 {
        font-size: 1.2rem;
    }
    
    .recipe-section li {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
}

/* iPhone Pro Max og større */
@media (min-width: 428px) {
    .christmas-title {
        font-size: 3rem;
    }
    
    .image-container {
        max-width: 350px;
    }
    
    .recipe-header h2 {
        font-size: 2.2rem;
    }
    
    .recipe-image {
        max-width: 320px;
    }
    
    .recipe-image img {
        max-height: 320px;
    }
}

/* Landscape orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .page {
        padding: 10px;
    }
    
    .christmas-title {
        font-size: 1.8rem;
    }
    
    .image-container {
        max-width: 200px;
        margin: 1rem 0;
    }
    
    .recipe-header {
        margin-bottom: 0.5rem;
    }
    
    .recipe-header h2 {
        font-size: 1.8rem;
    }
    
    .recipe-image {
        max-width: 200px;
        margin-bottom: 0.5rem;
    }
    
    .recipe-image img {
        max-height: 200px;
    }
    
    .recipe-section {
        padding: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .recipe-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .recipe-section li {
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }
    
    .recipe-content {
        margin-bottom: 60px;
    }
}

/* ===================================
   SCROLLBAR STYLING (webkit)
   =================================== */

.page::-webkit-scrollbar {
    width: 6px;
}

.page::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.page::-webkit-scrollbar-thumb {
    background:  rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.page::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}