/* ========================================
   CHESS THEME - ENHANCED STYLING
   ======================================== */

/* Chess-themed color variables */
:root {
    --chess-black: #1a1a1a;
    --chess-white: #f5f5f5;
    --chess-gold: #d4af37;
    --chess-silver: #c0c0c0;
    --chess-dark-square: #2c2c2c;
    --chess-light-square: #e8e8e8;
}

/* Animated chess board background pattern */
@keyframes chessboardSlide {
    0% { background-position: 0 0; }
    100% { background-position: 80px 80px; }
}

/* Hero background mit Parallax-Effekt und Chess Theme */
.section-image.hero {
    position: relative;
    min-height: 100vh;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Animated checkered overlay */
.section-image.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(45deg, rgba(0,0,0,0.7) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0,0,0,0.7) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.7) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.7) 75%);
    background-size: 80px 80px;
    background-position: 0 0, 0 40px, 40px -40px, -40px 0px;
    opacity: 0.15;
    animation: chessboardSlide 20s linear infinite;
    pointer-events: none;
    z-index: 1;
}

/* Dark gradient overlay for better text contrast */
.section-image.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.75) 100%);
    pointer-events: none;
    z-index: 2;
}

.hero .container {
    position: relative;
    z-index: 3;
}

/* Floating chess pieces animation */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes floatReverse {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(20px) rotate(-5deg); }
}

/* Hero content with enhanced animations */
.hero-content {
    width: 100%;
    text-align: center;
    will-change: transform, opacity;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 1000ms cubic-bezier(.2,.7,.2,1), 
                opacity 1000ms ease,
                scale 1000ms cubic-bezier(.2,.7,.2,1);
}

.hero-content.in-view {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Glowing chess-themed title */
.hero-title {
    color: var(--chess-gold);
    text-shadow: 
        0 0 10px rgba(212, 175, 55, 0.8),
        0 0 20px rgba(212, 175, 55, 0.6),
        0 0 30px rgba(212, 175, 55, 0.4),
        0 0 40px rgba(212, 175, 55, 0.2),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    font-size: clamp(4.5rem, 12vw, 9rem);
    font-family: 'Roboto', sans-serif;
    font-weight: 900;
    margin: 0;
    letter-spacing: .08em;
    animation: titleGlow 3s ease-in-out infinite;
    position: relative;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 
            0 0 10px rgba(212, 175, 55, 0.8),
            0 0 20px rgba(212, 175, 55, 0.6),
            0 0 30px rgba(212, 175, 55, 0.4),
            0 0 40px rgba(212, 175, 55, 0.2),
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
    50% {
        text-shadow: 
            0 0 20px rgba(212, 175, 55, 1),
            0 0 30px rgba(212, 175, 55, 0.8),
            0 0 40px rgba(212, 175, 55, 0.6),
            0 0 50px rgba(212, 175, 55, 0.4),
            2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

.hero-subtitle {
    color: var(--chess-silver);
    text-shadow: 
        0 0 15px rgba(255, 255, 255, 0.8),
        0 0 25px rgba(192, 192, 192, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.7);
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    font-size: clamp(2.2rem, 5.5vw, 4rem);
    margin: 1em 0 0 0;
    letter-spacing: .15em;
    animation: subtitleFade 2s ease-in-out;
}

@keyframes subtitleFade {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Chess piece decorative elements */
.chess-piece-decoration {
    position: absolute;
    font-size: 4rem;
    opacity: 0.1;
    color: var(--chess-gold);
    animation: float 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

.chess-piece-decoration:nth-child(2) {
    animation: floatReverse 7s ease-in-out infinite;
    animation-delay: 1s;
}

/* HTL Logo - Desktop Version anzeigen, Mobile Version verstecken */
.htl-logo-mobile {
    display: none;
}

/* Enhanced section styling with chess theme */
#abstract, #details {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    position: relative;
    overflow: hidden;
}

#abstract::before, #details::before {
    content: "♔ ♕ ♖ ♗ ♘ ♙";
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    color: var(--chess-gold);
    opacity: 0.1;
    letter-spacing: 2rem;
    pointer-events: none;
}

/* Animated cards with chess theme */
.card {
    transition: transform 0.4s cubic-bezier(.2,.7,.2,1), 
                box-shadow 0.4s ease,
                border 0.4s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    transition: left 0.5s ease;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.3);
    border: 2px solid var(--chess-gold);
}

.card:hover::before {
    left: 100%;
}

/* Team section with dark chess theme */
#team.section-dark {
    background: linear-gradient(135deg, var(--chess-black) 0%, var(--chess-dark-square) 100%);
    position: relative;
}

#team.section-dark::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(212, 175, 55, 0.03) 35px, rgba(212, 175, 55, 0.03) 70px);
    pointer-events: none;
}

.card-profile {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card-profile:hover {
    transform: translateY(-15px) rotate(2deg);
    box-shadow: 0 25px 50px rgba(212, 175, 55, 0.4);
}

.card-avatar img {
    transition: transform 0.4s ease, filter 0.4s ease;
    border: 3px solid var(--chess-gold);
    object-fit: cover;
    width: 100%;
    height: 100%;
    transform: scale(1.1);
}

.card-profile:hover .card-avatar img {
    transform: scale(1.2) rotate(-2deg);
    filter: brightness(1.1);
}

/* Team member description - always black text */
#team .card-profile .category.text-muted {
    color: #000000 !important;
}

/* Scroll reveal animation */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced navbar with chess theme */
.navbar {
    background: rgba(26, 26, 26, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--chess-gold);
    transition: all 0.3s ease;
}

.navbar-brand {
    color: var(--chess-gold) !important;
    font-weight: 700;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    color: var(--chess-silver) !important;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.navbar-nav > li > a {
    color: var(--chess-white) !important;
    transition: all 0.3s ease;
}

.navbar-nav > li > a:hover {
    color: var(--chess-gold) !important;
    background: rgba(212, 175, 55, 0.1) !important;
}

/* --- KORREKTUR FÜR MOBILE GERÄTE --- */
@media (max-width: 1920px) {
    .section-image.hero {
        background-attachment: scroll;
    }
}

/* Alle mobilen Geräte und Tablets - einheitliches Design wie iPad Pro */
@media (max-width: 1024px) {
    /* HTL Logo - Mobile Version anzeigen, Desktop Version verstecken */
    .htl-logo-desktop {
        display: none !important;
    }
    
    .htl-logo-mobile {
        display: block !important;
        margin-top: 30px;
        margin-bottom: 40px;
        text-align: center;
    }
    
    .htl-logo-mobile p {
        margin-bottom: 15px;
    }
    
    .htl-logo-mobile img {
        max-width: 250px;
        margin: 0 auto;
    }
    
    /* Chess piece decorations kleiner */
    .chess-piece-decoration {
        font-size: 2rem;
    }
    
    /* Mobile menu styling - einheitlich für alle Geräte */
    .navbar-toggle {
        display: block !important;
        background: transparent;
        border: 2px solid var(--chess-gold);
        border-radius: 4px;
        padding: 9px 10px;
        margin-top: 8px;
        margin-right: 15px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .navbar-toggle:hover,
    .navbar-toggle:focus {
        background: rgba(212, 175, 55, 0.2);
        border-color: var(--chess-silver);
    }
    
    .navbar-toggle .icon-bar {
        display: block;
        width: 22px;
        height: 2px;
        background-color: var(--chess-gold);
        border-radius: 1px;
        transition: all 0.3s ease;
    }
    
    .navbar-toggle .icon-bar + .icon-bar {
        margin-top: 4px;
    }
    
    .navbar-collapse {
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.3s ease-in-out;
        border-top: 1px solid transparent;
        width: 100% !important;
        background: rgba(26, 26, 26, 0.98);
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        box-shadow: none;
        border-radius: 0;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .navbar-collapse.in {
        max-height: 500px !important;
        border-top: 1px solid var(--chess-gold);
        overflow-y: auto !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    }
    
    .navbar-collapse.collapse {
        display: block !important;
        height: auto !important;
    }
    
    .navbar-collapse.collapse:not(.in) {
        max-height: 0 !important;
        overflow: hidden !important;
    }
    
    .navbar-nav {
        margin: 0 !important;
        padding: 7.5px 0 !important;
        float: none !important;
        width: 100% !important;
    }
    
    .navbar-nav > li {
        float: none !important;
        width: 100% !important;
    }
    
    .navbar-nav > li > a {
        padding: 15px 20px !important;
        margin: 0 !important;
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
        display: block !important;
        color: var(--chess-gold) !important;
        background: transparent !important;
        text-align: left !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .navbar-nav > li > a:hover,
    .navbar-nav > li > a:focus {
        color: var(--chess-silver) !important;
        background: rgba(212, 175, 55, 0.2) !important;
    }
    
    /* Fix für Team-Button im mobilen Menü - gleiche Ausrichtung wie andere Links */
    .navbar-nav > li > a.btn {
        padding: 15px 20px !important;
        margin: 0 !important;
        text-align: left !important;
        width: 100% !important;
        border: none !important;
        border-radius: 0 !important;
        display: block !important;
        box-sizing: border-box !important;
    }
    
    .navbar-nav > li > a .material-icons {
        margin-right: 5px;
        vertical-align: middle;
    }
    
    .navbar-header {
        float: none;
        position: relative;
        width: 100%;
    }
    
    .navbar-brand {
        display: block;
        float: left;
    }
    
    .navbar-toggle {
        float: right;
        margin-right: 0;
    }
    
    /* Container für Navbar muss relative sein */
    .navbar > .container {
        position: relative;
    }
    
    /* Verhindere dass das Menü als Box rechts erscheint */
    .navbar-right {
        float: none !important;
        margin-right: 0 !important;
    }
}

/* Spezifische Anpassungen für kleinere Handys */
@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem) !important;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 4vw, 1.5rem) !important;
    }
    
    h2.title {
        font-size: clamp(1.5rem, 7vw, 2.5rem) !important;
        white-space: nowrap !important;
        overflow: visible !important;
        padding: 0 2px !important;
    }
}

/* Anpassungen für größere Handys und kleine Tablets */
@media (min-width: 481px) and (max-width: 767px) {
    .hero-title {
        font-size: clamp(2.5rem, 9vw, 4rem) !important;
    }
    
    .hero-subtitle {
        font-size: clamp(1.3rem, 4.5vw, 2rem) !important;
    }
    
    h2.title {
        font-size: clamp(1.8rem, 7.5vw, 3rem) !important;
    }
}

/* Spezielle Anpassungen für iPad Mini (768x1024) und iPad Pro (1024x1366) im Portrait-Modus */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    /* Erzwinge mobile Navbar für iPads */
    .navbar-toggle {
        display: block !important;
    }
    
    .navbar-collapse.collapse {
        display: block !important;
        max-height: 0 !important;
        overflow: hidden !important;
    }
    
    .navbar-collapse.collapse.in {
        max-height: 500px !important;
        overflow-y: auto !important;
    }
    
    .navbar-nav {
        float: none !important;
        margin: 7.5px 0 !important;
    }
    
    .navbar-nav > li {
        float: none !important;
    }
    
    .navbar-nav > li > a {
        display: block !important;
        padding: 15px 20px !important;
    }
    
    /* HTL Logo Mobile anzeigen */
    .htl-logo-desktop {
        display: none !important;
    }
    
    .htl-logo-mobile {
        display: block !important;
    }
    
    /* Größere Titel für iPad Pro */
    .hero-title {
        font-size: clamp(3.5rem, 10vw, 6rem) !important;
    }
    
    .hero-subtitle {
        font-size: clamp(1.8rem, 5vw, 3rem) !important;
    }
    
    h2.title {
        font-size: clamp(2rem, 8vw, 4rem) !important;
    }
}

/* ========================================
   ADDITIONAL CHESS ENHANCEMENTS
   ======================================== */

/* Animated section titles */
.title {
    position: relative;
    display: inline-block;
    padding: 0 20px;
    color: var(--chess-black);
    font-weight: 700;
}

.title::before,
.title::after {
    content: "";
    position: absolute;
    bottom: -5px;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--chess-gold), var(--chess-silver));
    transition: width 0.6s ease;
}

.title::before {
    left: 50%;
}

.title::after {
    right: 50%;
}

.scroll-reveal.revealed .title::before,
.scroll-reveal.revealed .title::after {
    width: 50%;
}

/* Chess board pattern for sections */
.section-white {
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
}

/* Enhanced card images */
.card-image {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.card-image img {
    transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}

.card:hover .card-image img {
    transform: scale(1.1) rotate(2deg);
}

/* Glowing button effect */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

/* Footer enhancement */
.footer {
    background: linear-gradient(135deg, var(--chess-black) 0%, var(--chess-dark-square) 100%);
    border-top: 3px solid var(--chess-gold);
    position: relative;
}

.footer::before {
    content: "♔ ♕ ♖ ♗ ♘ ♙";
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--chess-gold);
    opacity: 0.2;
    letter-spacing: 1.5rem;
}

.footer a {
    color: var(--chess-silver);
    transition: all 0.3s ease;
}

.footer a:hover {
    color: var(--chess-gold);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* Text selection styling */
::selection {
    background: var(--chess-gold);
    color: var(--chess-black);
}

::-moz-selection {
    background: var(--chess-gold);
    color: var(--chess-black);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--chess-black);
}

::-webkit-scrollbar-thumb {
    background: var(--chess-gold);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--chess-silver);
}

/* Category badges */
.category {
    display: inline-block;
    padding: 5px 15px;
    background: linear-gradient(135deg, var(--chess-gold), var(--chess-silver));
    color: var(--chess-black);
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
}

.category:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

/* Animated background for abstract section */
#abstract {
    position: relative;
}

#abstract::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--chess-gold) 50%, 
        transparent 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Card title enhancement */
.card-title {
    color: var(--chess-black);
    font-weight: 700;
    transition: color 0.3s ease;
}

.card:hover .card-title {
    color: var(--chess-gold);
}

/* Description text enhancement */
.description {
    line-height: 1.8;
    color: #555;
}

/* Team section title in dark mode */
#team .title {
    color: var(--chess-gold);
}

#team .description {
    color: var(--chess-silver);
}

/* Smooth transitions for all interactive elements */
* {
    transition-property: background-color, color, border-color, transform, box-shadow;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Text in den Detail-Karten schwarz machen */
#details .card-description,
#details .description {
    color: #000000 !important;
}

/* Mobile-Ansicht der Detailkarten:
   Bild oben, Text darunter */
@media (max-width: 950px) {
    #details .card-blog .row {
        display: flex;
        flex-direction: column;      /* untereinander statt nebeneinander */
    }

    #details .card-blog .row > .col-md-5 {
        order: 1;                    /* Bild immer zuerst */
    }

    #details .card-blog .row > .col-md-7 {
        order: 2;                    /* Text immer darunter */
    }
}

