/* === Base Styles === */
:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --muted-color: #777777;
    --error-color: #ff3333;
    --accent-color: #ff0000;
    --overlay-color: rgba(0, 0, 0, 0.95);
    --border-color: #333333;
    --button-color: #333333;
    --button-hover: #444444;
    --transition-speed: 0.3s;
    --grid-gap: 10px;
    --icon-size: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    outline: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 0 15px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

.material-icons {
    font-size: var(--icon-size);
}

/* === iOS Touch Fixes === */
button, a, [onclick], .clickable {
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    -webkit-touch-callout: none;
    touch-action: manipulation;
    cursor: pointer;
}

/* === Burger Menu === */
.burger-menu {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1300; /* Højere end modal for altid at være synlig */
}

.burger-toggle {
    background: none;
    border: none;
    color: var(--muted-color);
    font-size: 24px;
    cursor: pointer;
    transition: color var(--transition-speed);
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.burger-toggle:hover {
    color: var(--text-color);
}

.burger-menu-content {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-speed);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.burger-menu.active .burger-menu-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.burger-menu-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.burger-menu-content li {
    margin-bottom: 15px;
}
.burger-menu-content li:last-child {
    margin-bottom: 0;
}

.burger-menu-content a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    transition: color var(--transition-speed);
    display: block;
    padding: 12px 0;
    margin: -2px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: rgba(255, 0, 0, 0.3);
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.burger-menu-content a:hover {
    color: var(--accent-color);
}

/* === Authentication Styles === */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-container {
    width: 90%;
    max-width: 400px;
    padding: 30px;
    border-radius: 8px;
    background-color: #000000;
    text-align: center;
    animation: fadeIn 0.5s ease-in-out;
}

.auth-logo {
    width: 180px;
    margin: 0 auto 30px;
    opacity: 0;
    animation: fadeIn 0.8s ease-in-out forwards;
    animation-delay: 0.3s;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-form input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--text-color);
    font-size: 16px;
}

.auth-form button {
    padding: 12px;
    background-color: var(--button-color);
    color: var(--text-color);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color var(--transition-speed);
    min-height: 44px;
}

.auth-form button:hover {
    background-color: var(--button-hover);
}

.auth-error {
    color: var(--error-color);
    font-size: 14px;
    min-height: 20px;
}

/* === Header Styles === */
header {
    padding: 30px 0;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.8s ease-in-out forwards;
}

.logo {
    width: 450px;
    margin: 0 auto;
    background-color: transparent;
}
/* === Gallery Styles === */
.image-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--grid-gap);
    margin-bottom: 40px;
}
.image-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    background-color: var(--bg-color);
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s, opacity 0.3s;
}

.image-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.image-item:hover img {
    transform: scale(1.03);
}

.image-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

.image-like {
    background-color: rgba(0, 0, 0, 0.6);
    color: var(--muted-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    min-width: 44px;
    min-height: 44px;
}

.image-like.liked {
    color: var(--accent-color);
}

.like-count {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-color);
}

/* === Modal Styles === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    overflow: hidden;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-close {
    position: fixed;
    top: 30px;
    left: 30px;
    font-size: 30px;
    color: var(--text-color);
    z-index: 1210;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.modal-content-wrapper {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.modal-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
    padding: 10px;
}

#modal-image {
    max-height: calc(100vh - 100px);
    max-width: calc(100vw - 20px);
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
}

.modal-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    min-height: 80px;
    z-index: 1205;
}

.modal-nav {
    font-size: 24px;
    color: var(--muted-color);
    padding: 10px;
    transition: color 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.modal-nav:hover {
    color: var(--text-color);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-color);
    font-size: var(--icon-size);
    transition: color 0.2s;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.modal-action-btn:hover {
    color: var(--text-color);
}

#modal-like {
    border-radius: 50%;
    background-color: rgba(30, 30, 30, 0.8);
    width: 44px;
    height: 44px;
}

#modal-like.liked {
    color: var(--accent-color);
}

.ninja-modal-icon {
    width: var(--icon-size);
    height: var(--icon-size);
    opacity: 0.7;
    margin-right: 15px;
}

/* === Footer Styles === */
footer {
    padding: 20px 0;
    text-align: center;
    color: var(--border-color);
    font-size: 14px;
    opacity: 0;
    animation: fadeIn 0.8s ease-in-out forwards;
    animation-delay: 0.5s;
}

/* === Animations === */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* === Body modal open state === */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* === Touch device hover fixes === */
@media (hover: none) {
    .burger-toggle:hover {
        color: var(--muted-color);
    }

    .burger-menu-content a:hover {
        color: var(--text-color);
    }

    .modal-nav:hover {
        color: var(--muted-color);
    }

    .modal-action-btn:hover {
        color: var(--muted-color);
    }

    .modal-close:hover {
        background-color: rgba(0, 0, 0, 0.7);
        transform: none;
    }

    .image-item:hover img {
        transform: none;
    }
}

/* === Responsive Styles === */
@media (min-width: 768px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-controls {
        position: relative;
        bottom: auto;
        background-color: var(--bg-color);
        backdrop-filter: none;
    }

    #modal-image {
        max-height: calc(100vh - 120px);
    }
}

@media (max-width: 767px) {
    .logo {
        width: 80%;
        max-width: 300px;
    }

    .burger-menu {
        top: 15px;
        right: 15px;
        z-index: 1300;
    }

    .burger-toggle {
        font-size: 22px;
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }

    .burger-menu-content {
        min-width: 180px;
        padding: 15px;
    }

    .modal {
        z-index: 1200;
    }

    .modal-close {
        top: 15px;
        left: 15px; /* Flyttet til venstre side på mobil */
        font-size: 24px;
        width: 40px;
        height: 40px;
    }

    .modal-content {
        padding: 5px;
    }

    #modal-image {
        max-height: calc(100vh - 80px);
        max-width: calc(100vw - 10px);
    }

    .modal-controls {
        position: fixed;
        bottom: 0;
        padding: 10px 15px;
        min-height: 60px;
    }

    .modal-nav {
        font-size: 20px;
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }

    .modal-actions {
        gap: 15px;
    }

    .modal-action-btn {
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }

    #modal-like {
        width: 40px;
        height: 40px;
    }
}
