/* ==========================================================================
   GENERAL.CSS - Globales Framework & Komponenten (Inkl. Standard- & Flip-Cards)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BASE & TYPOGRAFIE
   -------------------------------------------------------------------------- */

@font-face {
    font-family: 'Lato';
    src: url('../fonts/Lato-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('../fonts/Lato-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Oswald';
    src: url('../fonts/Oswald-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Oswald';
    src: url('../fonts/Oswald-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Lato', system-ui, -apple-system, sans-serif;
    color: #1e293b;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

h3 {
    font-size: 1.2rem;
}

/* --------------------------------------------------------------------------
   2. LAYOUT & SECTIONS
   -------------------------------------------------------------------------- */

main, section {
    flex: 1;
}

section {
    padding: 4rem 0;
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

section p {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Blaues Theme (Ungerade) */
section:nth-of-type(odd) {
    background-color: #0F75B8;
    background-image: url('../img/network-bg.svg');
    color: #ffffff;
}
section:nth-of-type(odd) h1,
section:nth-of-type(odd) h2,
section:nth-of-type(odd) h3 {
    color: #ffffff;
}

/* Helles Theme (Gerade) */
section:nth-of-type(even) {
    background-color: #f8fafc;
    background-image: url('../img/network-bg-dark.svg');
    color: #1e293b;
}
section:nth-of-type(even) h1,
section:nth-of-type(even) h2,
section:nth-of-type(even) h3 {
    color: #0F75B8;
}

/* Trennlinien Neon-Glow */
section::after,
section::before {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    background: linear-gradient(90deg, #00f0ff, #e000ff, #00ff88, #00f0ff);
    background-size: 200% 100%;
    animation: flow-glow 12s linear infinite;
}

section::after {
    bottom: -4px;
    height: 8px;
    z-index: 10;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.7), 0 0 12px rgba(0, 240, 255, 0.5);
}

section::before {
    bottom: -12px;
    height: 24px;
    z-index: 9;
    opacity: 0.5;
    filter: blur(10px);
    pointer-events: none;
}

@keyframes flow-glow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

.grid-1-col,
.grid-2-cols,
.grid-3-cols {
    grid-template-columns: 1fr;
}

.grid + .grid:has(.card) {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.grid h1 {
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1.25;
}

.grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

section:nth-of-type(odd) a {
    color: #ffffff;
    text-decoration: underline;
}

section:nth-of-type(odd) a:hover {
    opacity: 0.8;
}

section:nth-of-type(even) a {
    color: #0F75B8;
    text-decoration: underline;
}

section:nth-of-type(even) a:hover {
    opacity: 0.8;
}

/* Buttons */
.btn {
    font-weight: 700;
    font-size: 1rem;
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: transparent;
    color: #00d4ff;
    border: 2px solid #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.5), inset 0 0 10px rgba(0, 212, 255, 0.2);
    margin-top: 1rem;
}

.btn:hover {
    background-color: #00d4ff;
    color: #0b1528;
    text-decoration: none !important;
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.9), 0 0 10px rgba(0, 212, 255, 0.5);
    transform: translateY(-2px);
}

hr.tech-pulse {
    border: none;
    height: 2px;
    background-size: 200% 100%;
    margin: 50px 0;
    animation: dataStreamSlow 12s linear infinite;
}

section:nth-of-type(odd) hr.tech-pulse {
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.2), rgba(255, 255, 255, 0.8), rgba(0, 210, 255, 0.2));
}

section:nth-of-type(even) hr.tech-pulse {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.1), rgba(30, 41, 59, 0.6), rgba(30, 41, 59, 0.1));
}

@keyframes dataStreamSlow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
   3. STANDARD CARDS
   -------------------------------------------------------------------------- */

.card {
    position: relative;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    overflow: hidden;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
}

.card h3 {
    font-size: 1.25rem;
}

.card ul {
    list-style: none;
}

.card li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.card li::before {
    content: "• ";
    font-weight: bold;
    margin-right: 0.25rem;
}

.card-header {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.card-header .card-value {
    font-size: 2.2rem;
    line-height: 1;
    letter-spacing: -0.5px;
}

.card-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.card-icon img {
    width: 60px;
    height: 60px;
    box-shadow: none;
    transition: transform 0.3s ease;
}

.card:hover .card-icon img {
    transform: scale(1.08);
}

.card::before,
.card::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.card::before {
    top: 0;
    width: 40%;
    height: 2px;
    opacity: 0.8;
}

.card::after {
    bottom: 0;
    width: 30%;
    height: 2px;
    opacity: 0.6;
}

.card:hover::before,
.card:hover::after {
    width: 80%;
    opacity: 1;
}

section:nth-of-type(odd) .card {
    border: 1px solid rgba(0, 210, 255, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 10px 20px rgba(0, 0, 0, 0.2);
}

section:nth-of-type(odd) .card h3,
section:nth-of-type(odd) .card-header,
section:nth-of-type(odd) .card li::before {
    color: #00d2ff;
}

section:nth-of-type(odd) .card::before,
section:nth-of-type(odd) .card::after {
    background: #00d2ff;
    box-shadow: 0 0 12px 3px #00d2ff;
}

section:nth-of-type(odd) .card:hover {
    border-color: #00d2ff;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.4), 0 0 18px rgba(0, 210, 255, 0.4);
    transform: translateY(-3px);
}

section:nth-of-type(odd) .card:hover::before,
section:nth-of-type(odd) .card:hover::after {
    box-shadow: 0 0 15px 4px #00d2ff;
}

section:nth-of-type(even) .card {
    border: 1px solid rgba(15, 117, 184, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 8px 20px rgba(0, 0, 0, 0.05);
}

section:nth-of-type(even) .card h3,
section:nth-of-type(even) .card-header,
section:nth-of-type(even) .card li::before {
    color: #0F75B8;
}

section:nth-of-type(even) .card::before,
section:nth-of-type(even) .card::after {
    background: #0F75B8;
    box-shadow: 0 0 10px 2px rgba(15, 117, 184, 0.5);
}

section:nth-of-type(even) .card:hover {
    border-color: #0F75B8;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 12px 28px rgba(15, 117, 184, 0.2);
    transform: translateY(-4px);
}

section:nth-of-type(even) .card:hover::before,
section:nth-of-type(even) .card:hover::after {
    box-shadow: 0 0 12px 3px rgba(15, 117, 184, 0.8);
}

/* --------------------------------------------------------------------------
   4. FLIP CARDS (Inkl. Mobile-Touch-Unterstützung via .flipped)
   -------------------------------------------------------------------------- */

.flip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.flip-card {
    height: 180px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Desktop: Hover-Drehung */
@media (min-width: 992px) {
    .flip-card:hover .flip-card-inner {
        transform: rotateY(180deg);
    }
}

/* Mobile & Touch: Klick-Steuerung via JavaScript .flipped Klasse */
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, 
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flip-card-back {
    transform: rotateY(180deg);
}

.flip-card-back p {
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Flip Cards Theme 1 (Ungerade/Blau) */
section:nth-of-type(odd) .flip-card-front {
    border: 1px solid rgba(0, 210, 255, 0.3);
    background: rgba(255, 255, 255, 0.04);
}
section:nth-of-type(odd) .flip-card-front h3 {
    color: #ffffff;
}
section:nth-of-type(odd) .flip-card-back {
    background: #00d2ff;
    color: #0a192f;
}

/* Flip Cards Theme 2 (Gerade/Hell) */
section:nth-of-type(even) .flip-card-front {
    border: 1px solid rgba(15, 117, 184, 0.25);
    background: rgba(255, 255, 255, 0.04);
}
section:nth-of-type(even) .flip-card-front h3 {
    color: #0F75B8;
}
section:nth-of-type(even) .flip-card-back {
    background: #0F75B8;
    color: #ffffff;
}

/* Footer im Flex-Layout ganz unten halten */
footer {
    margin-top: auto;
}

/* --------------------------------------------------------------------------
   5. MEDIA QUERIES
   -------------------------------------------------------------------------- */

@media (min-width: 768px) and (max-width: 991px) {
    .grid-3-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    section { padding: 6rem 0; }
    .grid-2-cols { grid-template-columns: 1fr 1fr; }
    .grid-3-cols { grid-template-columns: repeat(3, 1fr); }
    .grid h1 { font-size: 2.2rem; }
}