/* ===========================
   VARIABLES & RESET
   =========================== */
:root {
    --primary: #00d4ff;
    --secondary: #ff006e;
    --dark: #0a0e27;
    --darker: #050812;
    --light: #f0f0f0;
    --accent: #00ff88;
    --warning: #ffa500;
    --success: #00ff88;
    --error: #ff0055;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
    color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===========================
   HEADER & NAVIGATION
   =========================== */
header {
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 2rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
    letter-spacing: 2px;
    white-space: nowrap;
}

nav {
    display: flex;
    gap: 2rem;
    flex: 1;
    justify-content: center;
}

nav a {
    color: var(--light);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

nav a:hover {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    border-radius: 5px;
    font-size: 0.9rem;
}

.lang-btn.active {
    background: var(--primary);
    color: var(--dark);
    box-shadow: 0 0 15px var(--primary);
}

/* ===========================
   HERO SECTION & INPUT
   =========================== */
.hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(255, 0, 110, 0.1) 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    width: 100%;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary);
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.hero .description {
    font-size: 1.1rem;
    color: var(--light);
    margin-bottom: 2rem;
}

.analyzer-input-container {
    display: flex;
    gap: 1rem;
    background: rgba(10, 14, 39, 0.8);
    padding: 1.5rem;
    border-radius: 15px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    flex-wrap: wrap;
}

.main-input {
    flex: 1;
    min-width: 300px;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    outline: none;
}

.main-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 15px var(--secondary);
}

.btn {
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--primary);
    color: var(--dark);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
}

/* ===========================
   ANALYZER DISPLAY
   =========================== */
.main-analyzer-section {
    padding: 3rem 0;
    background: var(--darker);
}

.analyzer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.video-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.live-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(10, 14, 39, 0.8);
    border-radius: 8px;
    border-left: 4px solid var(--error);
}

.live-badge {
    color: var(--error);
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

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

.analysis-card {
    background: rgba(10, 14, 39, 0.8);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.analysis-card h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding-bottom: 0.5rem;
}

/* Chat UI Improvements */
.chat-card {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.ai-chat-box {
    flex-grow: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.ai-messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.ai-msg {
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    max-width: 90%;
    animation: fadeIn 0.3s ease;
}

.ai-msg.user {
    background: rgba(0, 212, 255, 0.1);
    border-left: 3px solid var(--primary);
    align-self: flex-end;
    text-align: right;
}

.ai-msg.analysis {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-left: 3px solid var(--accent);
    align-self: flex-start;
}

.ai-msg.system {
    background: rgba(0, 212, 255, 0.05);
    color: var(--primary);
    border-left: 3px solid #ccc;
    font-style: italic;
    font-size: 0.85rem;
    align-self: center;
}

.chat-input-area {
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex-grow: 1;
    background: #1a1f3d;
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 10px;
    color: white;
    outline: none;
}

.send-btn {
    background: var(--primary);
    border: none;
    border-radius: 4px;
    padding: 0 15px;
    color: var(--dark);
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.send-btn:hover {
    background: var(--secondary);
    color: white;
}

.typing-indicator {
    padding: 10px;
    display: flex;
    gap: 5px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.field-analysis-row {
    margin-top: 2rem;
}

.canvas-wrapper {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}

.canvas-wrapper canvas {
    width: 100%;
    height: auto;
    display: block;
}

.full-width {
    width: 100%;
}

/* ===========================
   ABOUT & FOOTER
   =========================== */
.about {
    padding: 5rem 0;
    text-align: center;
}

footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--primary);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    .analyzer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .analyzer-input-container { flex-direction: column; }
    .main-input { width: 100%; }
    .btn { width: 100%; }
}
