* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: #0a1628;
    border: none;
    outline: none;
}

body {
    background: linear-gradient(to bottom, #0a1628, #2a3f5f);
    min-height: 100vh;
    font-family: 'Georgia', serif;
    overflow-x: hidden;
    border: none;
    outline: none;
}

/* Snøanimasjon */
.snowflake {
    position: fixed;
    top: -10px;
    z-index: 1;
    color: white;
    font-size: 1em;
    animation: fall linear infinite;
    opacity: 0.8;
    pointer-events: none;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
    border: none;
    outline: none;
}

.header {
    text-align: center;
    color: white;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    margin-bottom: 2rem;
    font-size: 3rem;
    font-weight: bold;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Login */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    z-index: 100;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 100%;
    position: relative;
    z-index: 101;
}

.login-title {
    font-size: 2rem;
    color: #c41e3a;
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-description {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
}

.login-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 102;
}

.login-input:focus {
    outline: none;
    border-color: #c41e3a;
}

.login-button {
    width: 100%;
    padding: 1rem;
    background: #c41e3a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
    z-index: 102;
}

.login-button:hover {
    background: #a01828;
}

.error-message {
    color: #c41e3a;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Julekalender */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.door {
    perspective: 1000px;
    cursor: pointer;
    aspect-ratio: 1;
}

.door.locked {
    cursor: not-allowed;
    opacity: 0.6;
}

.door:hover .door-inner {
    transform: scale(1.05);
}

.door.locked:hover .door-inner {
    transform: scale(1);
}

/* Riste-animasjon for låste luker */
@keyframes shake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-5px) rotate(-2deg); }
    75% { transform: translateX(5px) rotate(2deg); }
}

.door.shake .door-inner {
    animation: shake 0.4s ease-in-out;
}

.door-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.door.opened .door-inner {
    transform: rotateY(180deg);
}

.door-front, .door-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.door-front {
    background: linear-gradient(135deg, #c41e3a 0%, #8b1428 100%);
    border: 3px solid #ffd700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.door-back {
    background: linear-gradient(135deg, #2d5f2d 0%, #1a4d1a 100%);
    transform: rotateY(180deg);
    border: 3px solid #ffd700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.door-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.door-hint {
    color: #ffe066;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.door-locked-icon {
    color: #ffe066;
    font-size: 1.5rem;
    margin-top: 0.5rem;
}

.door-content {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.2s;
    text-align: center;
}

.door-content:hover {
    transform: scale(1.1);
    color: #ffe066;
}

.door-label {
    color: #ffe066;
    font-size: 0.8rem;
    margin-top: 0.5rem;
}

.counter {
    text-align: center;
    color: white;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hidden {
    display: none;
}

/* Fullskjerm bilde-modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* VIKTIG: Blokkerer ikke klikk når skjult */
}

.image-modal.show {
    opacity: 1;
    pointer-events: auto; /* Tillater klikk når den vises */
}

.modal-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(196, 30, 58, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1001;
}

.modal-close:hover {
    background: rgba(160, 24, 40, 1);
    transform: scale(1.1);
}

.modal-content {
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 3px solid #ffd700;
}

.modal-title {
    color: #ffd700;
    font-size: 2rem;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    font-weight: bold;
    text-align: center;
}

@media (max-width: 768px) {
    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-image {
        max-height: 60vh;
    }
}

.footer {
    position: fixed;
    bottom: 1rem;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    z-index: 50;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

