/* CSS Variables */
:root {
    --primary-color: #374151;
    --secondary-color: #6b7280;
    --light-color: #d1d5db;
    --background-color: #ffffff;
    --error-color: #ff6b6b;
    --transition-speed: 0.6s;
}

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

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    font-family: Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Device-specific overflow settings - Scroll-Variante */
html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body[data-device="desktop"] {
    overflow-y: scroll;
}

body[data-device="mobile"],
body[data-device="tablet"] {
    overflow-y: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body[data-device="mobile"]::-webkit-scrollbar,
body[data-device="tablet"]::-webkit-scrollbar {
    display: none;
}

/* Device-specific display classes */
.device-mobile { display: none; }
.device-tablet { display: none; }
.device-desktop { display: none; }

body[data-device="mobile"] .device-mobile { display: block; }
body[data-device="tablet"] .device-tablet { display: block; }
body[data-device="desktop"] .device-desktop { display: block; }

/* Container - Scroll-Variante */
.container {
    width: 100%;
    min-height: 100vh;
    position: relative;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body[data-device="desktop"] .container {
    overflow: visible;
}

body[data-device="mobile"] .container,
body[data-device="tablet"] .container {
    overflow: visible;
}

/* Sections - Scroll-Snap Variante */
.svg-section,
.video-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

body[data-device="desktop"] .svg-section,
body[data-device="desktop"] .video-section {
    overflow: visible;
}

body[data-device="mobile"] .svg-section,
body[data-device="mobile"] .video-section,
body[data-device="tablet"] .svg-section,
body[data-device="tablet"] .video-section {
    overflow: hidden;
}

/* Black background for specific sections - Anpassen nach Bedarf */
/* Falls gewünscht, bestimmte Sections mit schwarzem Hintergrund:
.svg-section:nth-child(2) {
    background-color: #000000;
}
*/

.svg-section.active,
.video-section.active {
    /* Nicht mehr benötigt für Scroll-Variante */
}

/* SVG Content */
.svg-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

body[data-device="desktop"] .svg-content {
    overflow: auto;
}

body[data-device="mobile"] .svg-content,
body[data-device="tablet"] .svg-content {
    overflow: hidden;
}

/* SVG Sizing */
body[data-device="desktop"] .svg-content svg {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    min-width: 300px;
    min-height: 300px;
    cursor: grab;
    transition: transform 0.2s ease;
    object-fit: contain;
}

body[data-device="desktop"] .svg-content svg:active {
    cursor: grabbing;
}

body[data-device="desktop"] .svg-content svg.zoomed {
    cursor: move;
}

body[data-device="mobile"] .svg-content svg {
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

body[data-device="tablet"] .svg-content svg {
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

/* Video Section */
.video-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 90vw;
    max-height: 90vh;
}

body[data-device="mobile"] .video-wrapper {
    max-width: 100vw;
    max-height: 100vh;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    background: #000;
}

body[data-device="mobile"] .video-wrapper video {
    border-radius: 0;
    max-height: 100vh;
}

.video-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 20;
}

body[data-device="mobile"] .video-controls {
    bottom: 60px;
    font-size: 0.8em;
}

.video-wrapper:hover .video-controls {
    opacity: 1;
}

/* Loading and Error States */
.loading {
    color: var(--secondary-color);
    font-size: 1.1em;
    text-align: center;
    animation: pulse 2s infinite;
}

body[data-device="mobile"] .loading {
    font-size: 1em;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.error {
    color: var(--error-color);
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
    max-width: 500px;
    font-size: 0.9em;
    position: relative;
    z-index: 100;
}

body[data-device="mobile"] .error {
    font-size: 0.8em;
    padding: 15px;
    max-width: 90%;
}

/* Navigation Dots */
.nav-dots {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body[data-device="tablet"] .nav-dots {
    right: 25px;
}

body[data-device="mobile"] .nav-dots {
    right: 0px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    padding: 10px 0px;
    border-radius: 20px 0 0 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    min-width: 60px;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--light-color);
    margin: 15px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

body[data-device="tablet"] .nav-dot {
    width: 14px;
    height: 14px;
    margin: 18px 0;
}

body[data-device="mobile"] .nav-dot {
    width: auto;
    height: auto;
    margin: 0;
    background: transparent;
    border-radius: 0;
    display: block;
    padding: 15px 20px;
    margin: 2px 0;
    position: relative;
    cursor: pointer;
    width: 100%;
    min-height: 50px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    border-radius: 20px 0 0 20px;
    transition: background-color 0.2s ease;
}

.nav-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
}

body[data-device="mobile"] .nav-dot::before {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--light-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
}

body[data-device="mobile"] .nav-dot::after {
    display: none;
}

.nav-dot.active {
    background: var(--primary-color);
    transform: scale(1.4);
}

body[data-device="mobile"] .nav-dot.active {
    background: rgba(55, 65, 81, 0.1);
    transform: none;
}

body[data-device="mobile"] .nav-dot.active::before {
    background: var(--primary-color);
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 0 0 10px rgba(55, 65, 81, 0.3);
}

body[data-device="desktop"] .nav-dot:hover {
    background: var(--secondary-color);
    transform: scale(1.2);
}

body[data-device="desktop"] .nav-dot:hover::after {
    background: rgba(55, 65, 81, 0.1);
}

body[data-device="mobile"] .nav-dot:active,
body[data-device="mobile"] .nav-dot.touching {
    background: rgba(55, 65, 81, 0.2);
}

/* Tooltip for Navigation Dots */
.nav-dot[title]:hover::before {
    content: attr(title);
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 0.85em;
    z-index: 1001;
    opacity: 0;
    animation: fadeInTooltip 0.3s ease-in-out forwards;
}

body[data-device="mobile"] .nav-dot[title]:hover::before {
    display: none;
}

@keyframes fadeInTooltip {
    to { opacity: 1; }
}

/* Section Counter */
.section-counter {
    position: fixed;
    bottom: 30px;
    left: 30px;
    color: var(--secondary-color);
    font-size: 0.9em;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

body[data-device="tablet"] .section-counter {
    bottom: 25px;
    left: 25px;
}

body[data-device="mobile"] .section-counter {
    bottom: 20px;
    left: 20px;
    font-size: 0.8em;
    padding: 6px 10px;
}

/* Device Info */
.device-info {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    font-size: 0.8em;
    color: var(--secondary-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
}

body[data-device="tablet"] .device-info {
    top: 15px;
    left: 15px;
}

body[data-device="mobile"] .device-info {
    top: 15px;
    left: 15px;
    font-size: 0.75em;
    padding: 5px 10px;
}

/* Zoom Controls (Desktop only) */
.zoom-controls {
    position: fixed;
    top: 20px;
    right: 30px;
    display: none;
    flex-direction: column;
    gap: 5px;
    z-index: 1000;
}

body[data-device="desktop"] .zoom-controls {
    display: flex;
}

.zoom-btn {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.zoom-btn:hover {
    background: #f0f0f0;
}

.scroll-hint {
    position: fixed;
    bottom: 30px;
    right: 30px;
    color: var(--secondary-color);
    font-size: 0.75em;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    text-align: center;
}

body[data-device="mobile"] .scroll-hint,
body[data-device="tablet"] .scroll-hint {
    display: none;
}

.scroll-hint:hover {
    opacity: 1;
}

/* Mobile Specific */
.mobile-swipe-hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--secondary-color);
    font-size: 0.8em;
    opacity: 0.6;
    z-index: 1000;
    text-align: center;
    animation: fadeInOut 3s ease-in-out infinite;
}

body[data-device="desktop"] .mobile-swipe-hint,
body[data-device="tablet"] .mobile-swipe-hint {
    display: none;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.mobile-swipe-hint::before {
    content: '👆';
    display: block;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.zoom-hint {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 0.75em;
    z-index: 999;
    opacity: 0;
    animation: showZoomHint 4s ease-in-out;
}

body[data-device="desktop"] .zoom-hint,
body[data-device="tablet"] .zoom-hint {
    display: none;
}

@keyframes showZoomHint {
    0%, 90%, 100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
    10%, 80% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Special Links Button */
.special-links-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

body[data-device="tablet"] .special-links-btn {
    bottom: 25px;
    width: 45px;
    height: 45px;
    font-size: 1.3em;
}

body[data-device="mobile"] .special-links-btn {
    bottom: 80px;
    width: 45px;
    height: 45px;
    font-size: 1.3em;
}

.special-links-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.special-links-btn:active {
    transform: scale(0.95);
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.popup-overlay.show {
    display: flex;
}

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

.popup-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.4s ease-out;
}

body[data-device="mobile"] .popup-container {
    max-width: 95vw;
    max-height: 95vh;
    padding: 20px;
}

body[data-device="tablet"] .popup-container {
    max-width: 600px;
}

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

.popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10001;
}

.popup-close:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

.popup-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.popup-header h2 {
    color: var(--primary-color);
    font-size: 1.5em;
    margin-bottom: 10px;
}

body[data-device="mobile"] .popup-header h2 {
    font-size: 1.3em;
}

.popup-header p {
    color: var(--secondary-color);
    font-size: 0.95em;
    line-height: 1.4;
}

.popup-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.popup-link {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

body[data-device="mobile"] .popup-link {
    padding: 12px;
}

.popup-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s ease;
}

.popup-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.popup-link:hover::before {
    left: 100%;
}

.popup-link:active {
    transform: translateY(0);
}

.popup-link-icon {
    font-size: 2em;
    margin-right: 15px;
    min-width: 50px;
    text-align: center;
}

body[data-device="mobile"] .popup-link-icon {
    font-size: 1.8em;
    margin-right: 12px;
    min-width: 45px;
}

.popup-link-content h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    font-weight: 600;
}

body[data-device="mobile"] .popup-link-content h3 {
    font-size: 1em;
}

.popup-link-content p {
    margin: 0;
    font-size: 0.85em;
    color: var(--secondary-color);
    line-height: 1.3;
}

body[data-device="mobile"] .popup-link-content p {
    font-size: 0.8em;
}

.popup-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    color: var(--secondary-color);
    font-size: 0.8em;
}

/* Responsive Breakpoints */
@media (max-width: 320px) {
    .nav-dots {
        right: 0px;
        padding: 8px 0px;
        min-width: 55px;
    }
    
    .nav-dot {
        min-height: 45px;
        padding: 12px 18px;
        margin: 1px 0;
    }
    
    .section-counter {
        bottom: 15px;
        left: 15px;
        font-size: 0.75em;
        padding: 5px 8px;
    }
    
    .device-info {
        top: 10px;
        left: 10px;
        font-size: 0.7em;
        padding: 4px 8px;
    }
    
    .mobile-swipe-hint {
        bottom: 70px;
        font-size: 0.7em;
    }
    
    .special-links-btn {
        bottom: 70px;
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-dots {
        right: 10px;
    }
    
    .nav-dot {
        margin: 8px 0;
    }
    
    .section-counter {
        bottom: 10px;
        left: 10px;
    }
    
    .special-links-btn {
        bottom: 10px;
    }
    
    .svg-content svg {
        object-fit: contain;
    }
    
    .video-wrapper video {
        max-height: 95vh;
    }
}
