:root {
    --primary-color: #d35400; /* Warmes Orange */
    --secondary-color: #fdf6e3; /* Cremiges Beige */
    --accent-color: #e74c3c; /* Korallrot */
    --text-color: #2c3e50; /* Dunkles Blaugrau */
    --bg-color: #ffffff; /* Hintergrund Container */
    --card-shadow: rgba(0, 0, 0, 0.1);
    --card-shadow-hover: rgba(211, 84, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #e67e22; /* Helles Orange fuer Dark Mode */
        --secondary-color: #1a1a2e; /* Dunkler Hintergrund */
        --accent-color: #ff6b6b; /* Helles Korall */
        --text-color: #ecf0f1; /* Heller Text */
        --bg-color: #16213e; /* Dunkler Container */
        --card-shadow: rgba(255, 255, 255, 0.05);
        --card-shadow-hover: rgba(230, 126, 34, 0.3);
    }
}

/* General styles to override or complement Bulma */
body {
    background-color: var(--secondary-color);
}

.title,
.subtitle,
.content,
.has-text-weight-bold {
    color: var(--text-color) !important;
}

h2.title {
    color: var(--primary-color) !important;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

/* Override Bulma's link colors */
.content a,
.subtitle a {
    color: var(--accent-color);
}
.content a:hover,
.subtitle a:hover {
    color: var(--primary-color);
}

/* Custom container style to match old design */
main.container {
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 0 10px var(--card-shadow);
    position: relative;
}

/* Custom utilities that Bulma doesn't have */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem var(--card-shadow);
    transition:
        box-shadow 0.3s ease-in-out,
        transform 0.3s ease-in-out;
}
.shadow-sm:hover {
    box-shadow: 0 0.5rem 1rem var(--card-shadow-hover);
    transform: translateY(-2px);
}
.is-rounded-lg {
    border-radius: 8px;
}

/* Game card specific styles */
.game-link .image img {
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.game-link.active .image img {
    border-color: var(--accent-color);
}

/* Iframe container */
.iframe-container {
    height: 80vh;
    width: 100%;
    border-radius: 6px;
    border: 1px solid var(--card-shadow);
    box-shadow: 0 0.5rem 1rem var(--card-shadow);
}

@media (max-width: 768px) {
    .iframe-container {
        height: 60vh;
    }
}

/* QR-Code Styling */
#qr-code {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 100px;
    height: 100px;
    background-color: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}
#qr-code img {
    width: 100% !important;
    height: 100% !important;
}

/* Fix for QR code overlap */
@media (min-width: 769px) {
    .intro-text {
        margin-right: 130px;
    }
}

/* Hide QR code on mobile */
@media (max-width: 768px) {
    #qr-code {
        display: none;
    }
}

/* Semester navigation */
.semester-nav .tag {
    cursor: pointer;
    transition: transform 0.2s ease;
}
.semester-nav .tag:hover {
    transform: scale(1.05);
}

/* Iframe wrapper and loader */
.iframe-wrapper {
    position: relative;
}

.iframe-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-color);
    z-index: 5;
}

.iframe-loader.is-hidden {
    display: none;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--secondary-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: scale(1.1);
    color: white;
}

/* Footer */
.footer {
    background-color: var(--bg-color);
    padding: 2rem 1.5rem;
    margin-top: 2rem;
}

.footer p {
    color: var(--text-color);
}

.footer a {
    color: var(--accent-color);
}

.footer a:hover {
    color: var(--primary-color);
}
