/**
 * Hero Section Layout
 * Positions text on left and cube on right
 */

/* Hero section container and positioning */
.hero-section {
    position: relative;
    background: var(--bg-primary);
    padding: 0; /* Remove all padding to eliminate gaps */
    margin: 0; /* Remove all margins */
    overflow: visible;
    z-index: 1;
    width: 100%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Using the header height variable we set in header-fix.css */
    top: 0 !important; /* Ensure proper alignment with header */
}

/* Important fix: Ensure no gap between header and hero */
header + .hero-section,
header + main .hero-section,
.header-adjusted {
    margin-top: -1px !important; /* Negative margin to eliminate gap */
    padding-top: 0 !important;
    border-top: none !important;
}

/* Fix for Firefox which can have different rendering behavior */
@-moz-document url-prefix() {
    .hero-section {
        margin-top: -1px !important;
    }
}

[data-theme="light"] .hero-section {
    background: var(--bg-primary); /* Match the background with the theme */
}

/* Hero container */
.hero-section .container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%; /* Ensure container takes full available width */
    margin: 0 auto;
    padding: 0 20px; /* Only horizontal padding */
    position: relative;
    z-index: 5;
    box-sizing: border-box; /* Ensure padding is included in width calculation */
    background: transparent; /* Ensure container is transparent */
}

/* Hero content (text side) */
.hero-content {
    flex: 1;
    max-width: 600px;
    padding-right: 30px;
    position: relative;
    z-index: 2;
}

/* Hero title */
.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

/* Hero subtitle */
.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Call to action buttons */
.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(108, 99, 255, 0.4);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* Stats section */
.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    color: var(--primary-color);
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Hero visual (cube side) */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    position: relative;
    z-index: 1;
}

/* Cube container - simplified */
.cube-container {
    perspective: 1000px;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
}

/* Mobile Anpassungen für den Würfel mit höchster Priorität - fix German language */
@media (max-width: 992px) {
    /* Cube position adjustments for mobile devices */
    .hero-section .hero-container .hero-visual .cube-container {
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        top: 75% !important;
        width: 150px !important;
        height: 150px !important;
    }
    
    .hero-content {
        width: 90% !important;
        max-width: 100% !important;
        right: 5% !important;
        top: 30% !important;
    }
}

/* Visual effects for hero section */
.hero-visual::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(108, 99, 255, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
}

/* Light theme adjustments */
[data-theme="light"] .hero-content {
    color: var(--dark-text);
}

[data-theme="light"] .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark-text);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Responsive design */
@media (max-width: 991px) {
    .hero-section .container {
        flex-direction: column;
        text-align: center;
        padding-top: 0; /* Remove top padding on mobile */
    }
    
    .hero-content {
        max-width: 100%;
        padding-right: 0;
        order: 1; /* Content first on mobile */
    }
    
    .hero-visual {
        order: 2; /* Visual below on mobile */
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .cube-container {
        margin: 0 auto;
    }
}

@media (max-width: 767px) {
    .hero-section {
        margin-top: 0 !important; /* Use !important to ensure this rule is applied */
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}

/**
 * Hero Section and Cube Layout Fixes
 * Ensures proper positioning and 3D display
 */

/* Enhanced 3D Cube styling */
.cube-container {
    perspective: 1000px;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
}

.cube {
    width: 200px;
    height: 200px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    transform: translate(-50%, -50%) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    animation: cube-rotate 20s infinite linear;
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
    background-color: rgba(30, 41, 59, 0.8);
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
    backface-visibility: visible;
    transform-style: preserve-3d;
}

.cube-face.front {
    transform: translateZ(100px);
}

.cube-face.back {
    transform: rotateY(180deg) translateZ(100px);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(100px);
}

.cube-face.bottom {
    transform: rotateX(-90deg) translateZ(100px);
}

.cube-face.left {
    transform: rotateY(-90deg) translateZ(100px);
}

.cube-face.right {
    transform: rotateY(90deg) translateZ(100px);
}

/* Ensure cube content is centered */
.cube-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.cube-content i {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--primary-color);
    display: block;
}

.cube-content span {
    display: block;
    font-size: 16px;
    font-weight: bold;
}

/* Animation keyframes - ensure consistent cube rotation */
@keyframes cube-rotate {
    0% {
        transform: translate(-50%, -50%) rotateX(0) rotateY(0) rotateZ(0);
    }
    100% {
        transform: translate(-50%, -50%) rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

/* Viewport height fix for mobile browsers */
.hero-section {
    min-height: 100vh; /* Fallback */
    min-height: calc(var(--vh, 1vh) * 100);
    padding-top: 0 !important; /* No extra padding needed as body has the header height padding */
}

/* Dynamic viewport height */
@supports (height: 100dvh) {
    .hero-section {
        min-height: 100dvh;
    }
}

/* Safari fixes */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .cube, .cube-face {
            -webkit-transform-style: preserve-3d;
            transform-style: preserve-3d;
            -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
        }
    }
}

/* Firefox specific fixes */
@supports (-moz-appearance:none) {
    .cube-face {
        backface-visibility: hidden;
    }
}

/* Background particles */
.hero-bg-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    display: none !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .cube {
        width: 150px;
        height: 150px;
    }
    
    .cube-face {
        width: 150px;
        height: 150px;
    }
    
    .cube-face.front {
        transform: translateZ(75px);
    }
    
    .cube-face.back {
        transform: rotateY(180deg) translateZ(75px);
    }
    
    .cube-face.top {
        transform: rotateX(90deg) translateZ(75px);
    }
    
    .cube-face.bottom {
        transform: rotateX(-90deg) translateZ(75px);
    }
    
    .cube-face.left {
        transform: rotateY(-90deg) translateZ(75px);
    }
    
    .cube-face.right {
        transform: rotateY(90deg) translateZ(75px);
    }
}

/* Hero section layout styles */

.hero,
.hero-section {
    width: 100%;
    position: relative;
    z-index: 5;
    padding: 0; /* Remove top padding */
    margin: 0; /* Remove top margin */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

/* Ensure hero connects directly to header */
header + .hero,
header + .hero-section,
header + main .hero,
header + main .hero-section {
    margin-top: 0 !important; /* Changed from -1px to fix the gap properly */
    border-top: 0 !important;
}

.hero-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-content {
    padding-top: 0; /* Removed redundant padding that was causing the gap */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

/* Adjust for fixed header positioning */
@media (max-width: 768px) {
    .hero-content {
        padding-top: 0; /* Removed redundant padding on mobile */
    }
    
    .hero,
    .hero-section {
        height: auto;
        min-height: 85vh;
        margin-top: 0 !important; /* Ensure no gap on mobile */
    }
}

/* Hero title */
.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Hero subtitle */
.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    line-height: 1.5;
    max-width: 80%;
    color: var(--text-secondary);
}

/* CTAs container */
.hero-ctas {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        max-width: 95%;
    }
    
    .hero-ctas {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
    }
}
