/* ========================================================================= */
/* ZENTRALES STYLESHEET (Für index.php & register.php)                      */
/* ========================================================================= */

/* --- BASE RESET & BODY --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
    /* Wichtig: Direkt hier den dunklen Hintergrund setzen, damit nichts weiß aufblitzt */
    background-color: #121212; 
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

body {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    padding-top: 150px;
    padding-bottom: 70px;
    overflow-x: hidden;
    opacity: 0;
    animation: fadeIn 0.4s ease-in-out forwards;
}

/* Spezifische Korrektur der Abstände für die register.php */
body.page-register {
    padding-top: 125px !important;
}

/* --- STICKY HEADER & BRANDING --- */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
    z-index: 1000;
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.header-logo-img {
    height: 30px;
    width: auto;
    display: block;
}

.header-titles {
    text-align: left;
}

.header-titles h2 {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.header-titles p {
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #aaaaaa;
    text-transform: uppercase;
    margin-top: 2px;
}

/* --- NAVIGATION & BUTTONS --- */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 1200px;
    position: relative;
    z-index: 1005;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
}

.nav-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: linear-gradient(180deg, #383838 0%, #222222 100%);
    border: 1px solid #4a4a4a;
    border-top: 1px solid #666;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    transition: all 0.25s ease;
}

.nav-btn:hover {
    background: linear-gradient(180deg, #444444 0%, #2a2a2a 100%);
    border-color: #777;
}

.nav-btn.active {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    font-weight: 600;
}

.custom-dropdown {
    position: relative;
    display: inline-block;
    width: 260px;
}

.dropdown-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #ffffff;
    background: linear-gradient(180deg, #383838 0%, #222222 100%);
    border: 1px solid #4a4a4a;
    border-top: 1px solid #666666;
    border-radius: 20px;
    padding: 0.55rem 1.4rem;
    cursor: pointer;
    outline: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: all 0.25s ease;
}

.dropdown-btn:hover {
    background: linear-gradient(180deg, #444444 0%, #2a2a2a 100%);
    border-color: #777777;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: #aaaaaa;
    margin-left: 12px;
    transition: transform 0.3s ease;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #444444;
    border-radius: 14px;
    padding: 6px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s ease;
    z-index: 1010;
}

.custom-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    color: #dddddd;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #7a1515;
    color: #ffffff;
}

.dropdown-item.active {
    background-color: #4a0d0d;
    color: #ffffff;
    font-weight: 600;
}

/* --- GALERIE INDEX (LAUFBÄNDER) --- */
.gallery-wrapper {
    position: relative;
    width: 100vw;
    overflow: hidden;
}

.gallery-focus-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    backdrop-filter: grayscale(100%) blur(5px) brightness(0.25);
    -webkit-backdrop-filter: grayscale(100%) blur(5px) brightness(0.25);
    mask-image: linear-gradient(to right, black 0%, rgba(0,0,0,0.9) 20%, transparent 35%, transparent 65%, rgba(0,0,0,0.9) 80%, black 100%);
    -webkit-mask-image: linear-gradient(to right, black 0%, rgba(0,0,0,0.9) 20%, transparent 35%, transparent 65%, rgba(0,0,0,0.9) 80%, black 100%);
}

.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(18, 18, 18, 0.85);
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 2px;
    color: #dddddd;
    text-transform: uppercase;
}

.gallery-mainframe {
    width: 100vw;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 15px 0;
    overflow: hidden;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.8s ease;
    will-change: transform, opacity;
}

.slide-out-left { transform: translateX(-100vw); opacity: 0.2; }
.slide-out-right { transform: translateX(100vw); opacity: 0.2; }
.slide-prepare-left { transition: none !important; transform: translateX(-100vw); opacity: 0.2; }
.slide-prepare-right { transition: none !important; transform: translateX(100vw); opacity: 0.2; }

.marquee-row {
    display: flex;
    width: 100%;
    overflow: hidden;
    user-select: none;
}

.marquee-content {
    display: flex;
    gap: 18px;
    flex-shrink: 0;
    will-change: transform;
}

.row-0.move-left { animation: scrollLeft 2200s linear infinite; }
.row-0.move-right { animation: scrollRight 2200s linear infinite; }
.row-1.move-left { animation: scrollLeft 2500s linear infinite; }
.row-1.move-right { animation: scrollRight 2500s linear infinite; }
.row-2.move-left { animation: scrollLeft 3000s linear infinite; }
.row-2.move-right { animation: scrollRight 3000s linear infinite; }
.row-3.move-left { animation: scrollLeft 500s linear infinite; }
.row-3.move-right { animation: scrollRight 500s linear infinite; }

.marquee-row:hover .marquee-content {
    animation-play-state: paused;
}

.gallery-item {
    position: relative;
    width: 280px;
    height: 280px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.5);
    background-color: #1a1a1a;
    transition: transform 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.9rem 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.gallery-item:hover .item-overlay { opacity: 1; }

.overlay-title { 
    font-size: 0.8rem; 
    font-weight: 500; 
    color: #fff; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    max-width: 68%;
}

.overlay-views {
    font-size: 0.8rem; 
    font-weight: 500; 
    color: #fff; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    max-width: 30%;
}

/* --- REGISTER SPEZIFISCHES DESIGN (SCREENSHOT-OPTICALS) --- */
.subbar-sticky-wrapper {
    position: sticky;
    top: 125px; /* Korrigiert, damit es perfekt unter dem Header greift und nicht unterwandert */
    z-index: 990;
    background-color: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(8px);
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 25px;
}

.index-subbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 15px;
}

.index-jump-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #cccccc;
    background: #222222;
    border: 1px solid #444444;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.index-jump-btn:hover {
    background: #7a1515;
    color: #ffffff;
    border-color: #901b1b;
}

.register-wrapper {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px 20px 20px;
}

.chapter-header {
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: #ffffff;
    border-bottom: 1px solid #333333;
    padding-bottom: 8px;
    margin: 30px 0 20px 0;
    text-transform: uppercase;
    scroll-margin-top: 180px;
}

.chapter-header:first-child { margin-top: 0; }

.register-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.register-item {
    background-color: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    min-width: 0;
}

.register-item:hover {
    transform: translateY(-2px);
    border-color: #555555;
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

.register-thumb {
    width: 95px;
    height: 95px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    border: 1px solid #333;
}

.register-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.register-thumb:hover img {
    transform: scale(1.08);
    filter: brightness(1.15);
}

.register-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.82rem;
    overflow: hidden;
    min-width: 0;
}

.reg-title {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.reg-technique {
    color: #aaaaaa;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.reg-links {
    display: flex;
    gap: 14px;
    font-size: 0.75rem;
    margin-top: 2px;
}

.reg-links a {
    color: #d4af37;
    text-decoration: none;
    transition: color 0.2s;
}

.reg-links a:hover { color: #fff; text-decoration: underline; }

.reg-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    font-size: 0.72rem;
    color: #777777;
}

.reg-footer-row span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

/* --- LIGHTBOX MODAL --- */
.lightbox-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.93);
    backdrop-filter: blur(12px);
    z-index: 20000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    padding-top: 80px;
}

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 90px;
    right: 35px;
    font-size: 38px;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
    z-index: 21000;
    transition: color 0.2s ease, transform 0.2s ease;
    user-select: none;
}

.lightbox-close:hover {
    color: #d4af37;
    transform: scale(1.15);
}

.lightbox-content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-height: 85vh;
    max-width: 90vw;
}

.lightbox-img-wrapper {
    position: relative;
    min-width: 250px;
    min-height: 250px;
    max-height: 65vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.8);
}

.lightbox-img {
    max-height: 65vh;
    width: auto;
    max-width: 85vw;
    object-fit: contain;
    cursor: zoom-in;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 6px;
}

.lightbox-img.loaded {
    opacity: 1;
}

.lightbox-img.zoomed {
    cursor: zoom-out;
    transform: scale(1.7);
}

.lightbox-info {
    margin-top: 1.2rem;
    text-align: center;
    color: #dddddd;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.lb-line-1 {
    font-size: 1.15rem;
    font-weight: 500;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.lb-line-2 {
    font-size: 0.8rem;
    color: #aaaaaa;
    font-weight: 300;
    letter-spacing: 0.3px;
}

.lb-line-3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 6px;
}

.lb-views-text {
    font-size: 0.8rem;
    color: #888888;
    font-weight: 400;
}

.lb-action-btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid #d4af37;
    padding: 4px 12px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.lb-action-btn:hover {
    background: #d4af37;
    color: #000000;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
}

/* --- STICKY FOOTER --- */
.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid #222222;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.sticky-footer p { font-size: 0.75rem; font-weight: 300; letter-spacing: 1px; color: #888888; }
.sticky-footer a { color: #888888; text-decoration: none; transition: color 0.2s ease; }
.sticky-footer a:hover { color: #ffffff; }
.footer-separator { margin: 0 0.8rem; color: #444444; }

/* --- KEYFRAME ANIMATIONS & RESPONSIVE --- */
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes scrollLeft { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scrollRight { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }

@media (max-width: 900px) {
    .register-container { grid-template-columns: 1fr; }
    .subbar-sticky-wrapper { top: 160px; }
}

@media (max-width: 768px) {
    body { padding-top: 190px; }
    .gallery-item { width: 220px; height: 220px; }
    .sticky-footer p { font-size: 0.65rem; }
    .footer-separator { margin: 0 0.4rem; }
    .loading-overlay { padding: 1rem 1.5rem; }
    .loading-text { font-size: 0.75rem; }
}

/* Garantiert, dass der Header immer im Vordergrund und klickbar ist */
.sticky-header {
    z-index: 9999 !important;
    pointer-events: auto !important;
}

.nav-buttons, .category-nav, .nav-btn, .custom-dropdown {
    pointer-events: auto !important;
    z-index: 10000 !important;
}

.list-year {
    font-weight: 700;
    color: #ffffff;
}
/* --- SCROLL-REVEAL EFFEKT FÜR REGISTER-EINTRÄGE --- */
.register-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    will-change: opacity, transform;
}

.register-item.visible {
    opacity: 1;
    transform: translateY(0);
}
/* --- HANDY-ANPASSUNG FÜR DEN HEADER & MENÜS --- */
@media (max-width: 768px) {
    .sticky-header {
        padding: 0.8rem 1rem;
        gap: 0.8rem;
    }
    
    .header-brand {
        gap: 0.8rem;
    }
    
    .header-logo-img {
        height: 35px;
    }
    
    .header-titles h2 {
        font-size: 1rem;
    }
    
    .header-titles p {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }
    
    /* Navigation untereinander anordnen auf Smartphones */
    .category-nav {
        flex-direction: column;
        width: 100%;
        gap: 6px;
    }
    
    .custom-dropdown {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .dropdown-btn {
        width: 100% !important;
        justify-content: center;
    }
    
    .dropdown-menu {
        width: 100% !important;
    }
}
/* --- SPEZIFISCHES DESIGN FÜR VIEWREGISTER (RANKING NUMMERN) --- */
.register-item.rank-item {
    position: relative;
    overflow: hidden;
}

.rank-bg-number {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Impact', 'Arial Black', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 7.5rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.08);
    line-height: 1;
    text-align: center;
    width: 130px;
    letter-spacing: normal;
    pointer-events: none;
    z-index: 1;
}

/* Damit die Textinhalte immer sauber über der Hintergrundnummer liegen */
.register-item.rank-item .register-thumb,
.register-item.rank-item .register-info {
    position: relative;
    z-index: 2;
}

/* --- STATISTIKZEILE ZENTRIERT & MIT ABSTAND --- */
.viewregister-stats {
    max-width: 1300px;
    margin: 35px auto 45px auto; /* Generöser Abstand nach oben zu den Karten */
    padding: 10px 0;
    font-size: 0.85rem;
    color: #aaaaaa;
    display: flex;
    justify-content: center; /* Zentriert die Angaben mittig in der Karte */
    align-items: center;
    gap: 40px; /* Sauberer Abstand zwischen den Views und Jahren */
    letter-spacing: 0.5px;
    text-align: center;
}

.viewregister-stats span {
    color: #ffffff;
    font-weight: 600;
    margin-left: 4px; /* Abstand zwischen Text und der Zahl */
}

/* Aktiver Zustand für die Top-Sprungbuttons im Submenu */
.index-jump-btn.active-top-btn {
    background: #7a1515 !important;
    color: #ffffff !important;
    border-color: #901b1b !important;
}
/* Erhöht die Deckkraft der Ranking-Nummer beim Hover über die Karte von 8% auf 40% */
.register-item.rank-item:hover .rank-bg-number {
    color: rgba(255, 255, 255, 0.40);
    transition: color 0.3s ease;
}
/* --- SANFTER FADE-IN FÜR DIE TOP-CONTAINER --- */
@keyframes containerFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.register-container.fade-animate {
    animation: containerFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- SCHICKER, BENUTZERDEFINIERTER TOOLTIP FÜR UPLOAD-KARTEN --- */
.register-item.rank-item {
    position: relative; /* Basis für die absolute Tooltip-Positionierung */
}

.card-tooltip {
    position: absolute;
    top: 15px;
    right: 20px;
    background-color: #e5e5e5; /* Heller, edler Grau-Ton */
    color: #1a1a1a; /* Dunkler Text für perfekten Kontrast */
    padding: 8px 14px;
    border-radius: 8px; /* Abgerundete Ecken */
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); /* Schicker Schatten */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 20;
    pointer-events: none;
}

/* Tooltip wird beim Hover über die GESAMTE Karte sichtbar */
.register-item.rank-item:hover .card-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}