/* =====================================================
   TSABB CanSat — Shared Stylesheet
   ===================================================== */

/* --- CSS VARIABLES --- */
:root {
    --bg-deep: #05020a;
    --bg-card: rgba(20, 10, 30, 0.4);
    --primary: #a64dff;
    --primary-glow: rgba(166, 77, 255, 0.6);
    --secondary: #ffffff;
    --accent-cyan: #5dc1da;
    --accent-green: #00ff41;
    --text-main: #ffffff;
    --text-muted: #dcd6e5;
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'Consolas', 'Monaco', monospace;
}

/* --- RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }
body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- STARFIELD CANVAS --- */
#starfield {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1a0b2e 0%, #000000 100%);
}

/* =====================================================
   NAVIGATION
   ===================================================== */
nav {
    position: fixed; top: 20px; left: 5%; width: 90%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.8rem 2rem;
    background: rgba(10, 5, 20, 0.6);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(166,77,255,0.1);
    transition: all 0.4s ease;
}
nav:hover { border-color: rgba(166,77,255,0.3); box-shadow: 0 10px 40px rgba(166,77,255,0.15); }

.logo {
    font-size: 1.5rem; font-weight: 800;
    color: var(--text-main); text-decoration: none;
    display: flex; align-items: center; gap: 15px; letter-spacing: 1px;
}
.logo img { height: 40px; width: auto; filter: drop-shadow(0 0 5px var(--primary-glow)); transition: transform 0.5s ease; }
.logo:hover img { transform: rotate(15deg) scale(1.1); }

.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
    color: var(--text-muted); text-decoration: none;
    font-weight: 600; font-size: 0.85rem;
    text-transform: uppercase; letter-spacing: 1.5px;
    position: relative; transition: color 0.3s;
}
.nav-links a::before {
    content: ''; position: absolute; bottom: -6px; left: 50%;
    transform: translateX(-50%);
    width: 6px; height: 6px;
    background: var(--accent-cyan); border-radius: 50%;
    opacity: 0; transition: 0.3s; box-shadow: 0 0 10px var(--accent-cyan);
}
.nav-links a:hover { color: #fff; }
.nav-links a:hover::before { opacity: 1; bottom: -10px; }
.nav-links a.active { color: var(--primary); }

/* --- LANGUAGE SELECTOR --- */
.lang-selector {
    display: flex;
    gap: 8px;
    margin-left: 20px;
    align-items: center;
}
.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.3s;
    text-transform: uppercase;
}
.lang-btn:hover {
    border-color: var(--primary);
    color: #fff;
    background: rgba(166, 77, 255, 0.1);
}
.lang-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.burger { display: none; cursor: pointer; }
.burger div { width: 25px; height: 3px; background-color: var(--text-main); margin: 5px; transition: all 0.3s ease; }

/* =====================================================
   HERO
   ===================================================== */
header.hero {
    min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center; padding: 100px 20px 0;
    position: relative; overflow: hidden; perspective: 1000px;
}
.grid-floor {
    position: absolute; bottom: -30%; left: -50%; width: 200%; height: 100%;
    background-image: linear-gradient(rgba(166,77,255,0.3) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(166,77,255,0.3) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: rotateX(75deg); z-index: -1;
    mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 60%);
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 60%);
    animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
    0%   { transform: rotateX(75deg) translateY(0); }
    100% { transform: rotateX(75deg) translateY(40px); }
}
.hero-content { z-index: 10; }
.hero h1 {
    font-size: 5.5rem; line-height: 1; margin-bottom: 1rem;
    font-weight: 800; letter-spacing: -2px;
    background: linear-gradient(to bottom, #fff, #a64dff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(166,77,255,0.4));
}
.hero h1 span {
    display: block; font-size: 2rem; letter-spacing: 10px; text-transform: uppercase;
    background: none; -webkit-text-fill-color: var(--accent-cyan);
    margin-bottom: 10px; font-weight: 400;
}
.hero p {
    font-size: 1.2rem; color: var(--text-muted); max-width: 600px;
    margin: 0 auto 2.5rem;
    border-left: 2px solid var(--accent-cyan); padding-left: 15px; text-align: left;
}
.btn-group { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.btn-main {
    padding: 1rem 3rem; background: var(--primary); color: #fff;
    font-weight: bold; text-transform: uppercase; letter-spacing: 1px;
    border-radius: 50px; text-decoration: none;
    position: relative; overflow: hidden; transition: all 0.3s;
    box-shadow: 0 0 20px var(--primary-glow);
}
.btn-main::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: 0.5s;
}
.btn-main:hover::before { left: 100%; }
.btn-main:hover { transform: translateY(-3px); box-shadow: 0 0 40px var(--primary-glow); }
.btn-secondary {
    /* 1. Force the layout to never break */
    display: flex !important;
    width: fit-content !important;
    margin: 0 auto !important; /* Centers the button */
    white-space: nowrap !important; /* Stops the arrow from dropping down */
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important; /* Adds clean space between text and the arrow */
    box-sizing: border-box !important;

    /* 2. Responsive Padding */
    padding: 1rem clamp(1rem, 4vw, 2.5rem) !important; 
    
    /* 3. Your Visual Styles */
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important; 
    color: #fff !important;
    font-weight: bold !important; 
    text-transform: uppercase !important; 
    letter-spacing: 1px !important;
    border-radius: 50px !important; 
    text-decoration: none !important; 
    transition: all 0.3s ease !important;
}

/* Mobile Adjustment to shrink text so it fits */
@media (max-width: 480px) {
    .btn-secondary {
        font-size: 0.8rem !important;
        letter-spacing: 0.5px !important;
    }
}

.btn-secondary:hover { 
    background: rgba(255,255,255,0.1) !important; 
    border-color: #fff !important; 
}
/* =====================================================
   SECTIONS
   ===================================================== */
section { padding: 100px 10%; }

.section-title {
    font-size: 3rem; margin-bottom: 4rem; text-align: center;
    color: var(--text-main); letter-spacing: 2px; text-transform: uppercase;
}
.section-title::after {
    content: ''; display: block; width: 60px; height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 15px auto 0;
}

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

@keyframes float {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* =====================================================
   CARDS
   ===================================================== */
.card-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.card {
    background: var(--bg-card); backdrop-filter: blur(12px);
    border: 1px solid rgba(166,77,255,0.1);
    padding: 2.5rem; border-radius: 15px;
    transition: all 0.3s ease; height: 100%;
    position: relative; overflow: hidden;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent, rgba(166,77,255,0.05), transparent);
    transform: translateX(-100%); transition: 0.5s;
}
.card:hover::before { transform: translateX(100%); }
.card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 0 20px rgba(166,77,255,0.2); }
.card h3 { color: var(--primary); margin-bottom: 1rem; font-size: 1.5rem; }
.card ul { list-style-position: inside; color: var(--text-muted); margin-top: 10px; }

/* =====================================================
   TEAM
   ===================================================== */
.team-grid { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; margin-top: 20px; }
.team-member {
    text-align: center; width: 260px;
    background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(10px); padding: 35px 20px;
    border-radius: 20px; border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative; animation: float 6s ease-in-out infinite;
}
.team-member:nth-child(2) { animation-delay: 1s; }
.team-member:nth-child(3) { animation-delay: 2s; }
.team-member:hover {
    transform: translateY(-15px); border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(166,77,255,0.15);
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
}
.team-member img {
    width: 130px; height: 130px; border-radius: 50%; object-fit: cover;
    border: 3px solid rgba(255,255,255,0.1); margin-bottom: 20px; transition: 0.5s;
    /* Placeholder background when image is missing */
    background: linear-gradient(135deg, #1a0b2e, #2d1060);
}
.team-member:hover img { border-color: var(--accent-cyan); box-shadow: 0 0 20px rgba(93,193,218,0.4); transform: scale(1.05); }
.team-member h4 { color: #fff; margin-bottom: 5px; font-size: 1.3rem; font-weight: 700; }
.team-member .role { color: var(--accent-cyan); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
.role-tag {
    display: inline-block; margin-top: 15px; padding: 5px 12px;
    background: rgba(255,255,255,0.05); border-radius: 15px;
    font-size: 0.75rem; color: #aaa; border: 1px solid rgba(255,255,255,0.05);
}

/* Photo placeholder styling */
.team-member img[src=""],
.team-member img:not([src]) {
    background: linear-gradient(135deg, #1a0b2e, #2d1060);
    content: "";
}

.team-section-label {
    text-align: center; color: var(--text-muted);
    margin: 60px 0 30px; text-transform: uppercase;
    letter-spacing: 3px; font-size: 0.9rem;
}
.team-section-label:first-of-type { margin-top: 20px; }

/* =====================================================
   GALLERY PREVIEW (index) & FULL GALLERY PAGE
   ===================================================== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 15px; }
.gallery-item {
    height: 200px; border-radius: 10px; overflow: hidden;
    background: #222; position: relative;
    /* Placeholder pattern for missing images */
    background-image: repeating-linear-gradient(
        45deg, #1a1a2e 0, #1a1a2e 10px, #111130 10px, #111130 20px
    );
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover img { transform: scale(1.1); }

/* Placeholder label for gallery items without images */
.gallery-item .photo-placeholder {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 8px;
    color: rgba(255,255,255,0.2); font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 1px; pointer-events: none;
}
.gallery-item .photo-placeholder svg { opacity: 0.3; }

.gallery-view-all {
    text-align: center; margin-top: 3rem;
}

/* =====================================================
   TERMINAL
   ===================================================== */
.terminal-container {
    background: #000; border: 1px solid #333; border-radius: 8px;
    font-family: var(--font-mono); padding: 20px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    max-width: 1000px; margin: 0 auto;
    position: relative; overflow: hidden;
}
.terminal-container::after {
    content: " "; display: block; position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18,16,16,0) 50%, rgba(0,0,0,0.25) 50%),
                linear-gradient(90deg, rgba(255,0,0,0.06), rgba(0,255,0,0.02), rgba(0,0,255,0.06));
    z-index: 2; background-size: 100% 2px, 3px 100%; pointer-events: none;
}
.terminal-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #333; padding-bottom: 10px; margin-bottom: 15px;
}
#status {
    font-weight: bold; padding: 5px 10px; border-radius: 4px;
    background: #1a1a1a; font-size: 0.9rem; color: orange;
    z-index: 3; position: relative;
}
.log-window {
    height: 400px; overflow-y: scroll; background: #050505;
    border: 1px solid #222; padding: 10px; font-size: 13px;
    position: relative; z-index: 1;
}
.log-window::-webkit-scrollbar { width: 5px; }
.log-window::-webkit-scrollbar-thumb { background: #333; }
.terminal-row-header, .entry {
    display: grid;
    grid-template-columns: 0.8fr 0.5fr 1.5fr 0.5fr 0.8fr 0.5fr;
    gap: 5px; padding: 4px 10px;
    border-bottom: 1px solid #1a1a1a;
}
.terminal-row-header { color: #888; font-weight: bold; border-bottom: 1px solid #333; padding-bottom: 8px; margin-bottom: 5px; }
.entry.live { color: var(--accent-green); text-shadow: 0 0 5px rgba(0,255,65,0.5); }

/* =====================================================
   GRAFANA GRAPHS
   ===================================================== */
.graph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem; margin-top: 2rem;
}
.graph-panel {
    background: #000; border: 1px solid #333; border-radius: 15px;
    overflow: hidden; height: 350px; position: relative;
    transition: transform 0.3s ease; box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.graph-panel::before {
    content: ''; position: absolute; top: 0; left: 0; width: 20px; height: 20px;
    border-top: 2px solid var(--accent-cyan); border-left: 2px solid var(--accent-cyan);
    z-index: 5; border-radius: 4px 0 0 0;
}
.graph-panel::after {
    content: ''; position: absolute; bottom: 0; right: 0; width: 20px; height: 20px;
    border-bottom: 2px solid var(--primary); border-right: 2px solid var(--primary);
    z-index: 5; border-radius: 0 0 4px 0;
}
.graph-panel:hover { transform: scale(1.02); border-color: var(--primary); box-shadow: 0 0 30px rgba(166,77,255,0.2); }
.graph-panel iframe { width: 100%; height: 100%; border: none; filter: contrast(1.1) brightness(0.9); }

/* =====================================================
   FOOTER
   ===================================================== */
footer {
    background: rgba(0,0,0,0.8); padding: 3rem 10%;
    text-align: center; border-top: 1px solid rgba(255,255,255,0.1); margin-top: 50px;
}
.footer-links a {
    color: var(--primary); margin: 0 15px; text-decoration: none;
    font-weight: bold; transition: 0.3s;
}
.footer-links a:hover { color: #fff; text-shadow: 0 0 10px var(--primary); }

/* =====================================================
   PAGE HEADER (subpages)
   ===================================================== */
.page-header {
    min-height: 35vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; text-align: center;
    padding: 120px 20px 60px; position: relative; overflow: hidden;
}
.page-header h1 {
    font-size: 3.5rem; font-weight: 800; letter-spacing: -1px;
    background: linear-gradient(to bottom, #fff, var(--primary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 20px rgba(166,77,255,0.3));
}
.page-header h1 span { -webkit-text-fill-color: var(--accent-cyan); }
.page-header p { color: var(--text-muted); margin-top: 1rem; font-size: 1rem; }
.btn-back {
    display: inline-block; padding: 0.8rem 2rem;
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    color: #fff; text-transform: uppercase; border-radius: 50px;
    text-decoration: none; transition: 0.3s; font-weight: bold; letter-spacing: 1px;
    margin-top: 2rem;
}
.btn-back:hover { background: rgba(255,255,255,0.1); border-color: var(--primary); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media screen and (max-width: 768px) {
    nav { width: 100%; top: 0; left: 0; border-radius: 0; border: none; border-bottom: 1px solid rgba(255,255,255,0.1); padding: 1rem; }
    .nav-links {
        position: absolute; right: 0; height: 100vh; top: 0;
        background-color: #05020a; flex-direction: column; width: 80%;
        transform: translateX(100%); transition: transform 0.5s ease-in;
        border-left: 1px solid #333; justify-content: center; padding: 0;
    }
    .nav-active { transform: translateX(0%); }
    .burger { display: block; z-index: 1001; }
    .lang-selector { margin-left: 0; margin-top: 2rem; justify-content: center; }
    .hero h1 { font-size: 2.8rem; }
    .hero h1 span { font-size: 1.2rem; letter-spacing: 5px; }
    .terminal-row-header { display: none; }
    .entry {
        grid-template-columns: 1fr 1fr; font-size: 0.8rem;
        padding: 10px; border-bottom: 1px solid #333;
    }
    .entry span:nth-child(1) { color: #888; }
    .entry span:nth-child(2) { text-align: right; font-weight: bold; }
    .entry span:nth-child(3) { grid-column: span 2; color: #aaa; font-size: 0.75rem; }
    .entry span:nth-child(4) { color: var(--accent-cyan); }
    .entry span:nth-child(5) { color: #fff; }
    .entry span:nth-child(6) { text-align: right; color: var(--accent-green); }
    .graph-grid { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 2.2rem; }
    .section-title { font-size: 2rem; }
}
