/* ===========================================
   SwissVibeCoding v4 — Swiss Quality Design
   Basierend auf v01, erweitert fuer v4
   =========================================== */

:root {
    --swiss-red: #D52B1E;
    --swiss-red-dark: #B01E14;
    --swiss-red-light: #FF4136;
    --bg-primary: #0F0F13;
    --bg-secondary: #1A1A24;
    --bg-tertiary: #252533;
    --bg-chat: #12121A;
    --text-primary: #F5F5F7;
    --text-secondary: #A0A0B0;
    --text-muted: #6B6B7B;
    --border-color: #2A2A3A;
    --border-light: #353545;
    --accent-gradient: linear-gradient(135deg, #D52B1E 0%, #FF6B5A 100%);
    --glass-bg: rgba(26, 26, 36, 0.85);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(213, 43, 30, 0.15);
    --green: #34D399;
    --blue: #4a9eff;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100dvh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* === COOKIE BANNER === */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 16px 20px;
    z-index: 1000;
    display: none; /* shown via JS */
}

.cookie-banner.visible { display: block; }

.cookie-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.cookie-content a { color: var(--blue); text-decoration: none; }
.cookie-content a:hover { text-decoration: underline; }

.cookie-btn {
    background: var(--swiss-red);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    font-family: var(--font);
    white-space: nowrap;
    transition: var(--transition);
}

.cookie-btn:hover { background: var(--swiss-red-dark); }

/* === HERO === */
.hero {
    position: relative;
    padding: 40px 0 30px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(213, 43, 30, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.logo-icon svg {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 4px 12px rgba(213, 43, 30, 0.3));
}

.logo-text h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.logo-text .accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
}

.hero-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
}

/* === CHAT CONTAINER === */
.chat-section { padding: 0 0 40px; }

.chat-container {
    background: var(--bg-chat);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 65vh;
    min-height: 450px;
    max-height: 700px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6B6B7B;
    transition: var(--transition);
}

.status-dot.online {
    background: var(--green);
    animation: pulse 2s infinite;
}

.status-dot.offline { background: #ef4444; }

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

.bot-capabilities {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
    background: var(--bg-tertiary);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.message-avatar svg { width: 32px; height: 32px; }

.message.user .message-avatar {
    background: var(--bg-tertiary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.message-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.65;
}

.message.user .message-content {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

.message-content p { margin-bottom: 8px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content ul { margin: 8px 0; padding-left: 20px; }
.message-content li { margin-bottom: 4px; color: var(--text-secondary); }
.message.user .message-content li { color: rgba(255,255,255,0.85); }
.message-content strong { color: var(--text-primary); font-weight: 600; }
.message.user .message-content strong { color: white; }

/* Typing indicator */
.typing-indicator { display: flex; gap: 4px; padding: 4px 0; }

.typing-indicator span {
    width: 6px; height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Submit Banner */
.submit-banner {
    padding: 12px 24px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(52, 211, 153, 0.05) 100%);
    border-top: 1px solid rgba(52, 211, 153, 0.2);
    border-bottom: 1px solid rgba(52, 211, 153, 0.2);
}

.submit-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--green);
}

.btn-submit {
    margin-left: auto;
    background: var(--green);
    color: #0F0F13;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.btn-submit:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.btn-submit.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    margin-left: 8px;
}

.btn-submit.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Chat Input */
.chat-input-area {
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    transition: var(--transition);
}

.chat-input-wrapper:focus-within {
    border-color: var(--swiss-red);
    box-shadow: 0 0 0 3px rgba(213, 43, 30, 0.1);
}

#chatInput {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 21px;
}

#chatInput::placeholder { color: var(--text-muted); }

.btn-mic {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-mic:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.btn-mic.recording {
    background: var(--swiss-red);
    border-color: var(--swiss-red);
    color: white;
    animation: pulse 1s infinite;
}

.btn-send {
    background: var(--swiss-red);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-send:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-send:not(:disabled):hover {
    background: var(--swiss-red-dark);
    transform: translateY(-1px);
}

.chat-input-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.char-count { font-size: 11px; color: var(--text-muted); }

/* === STATUS SECTION === */
.status-section { padding: 0 0 40px; }

.status-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.status-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
}

.status-bot-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.status-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.status-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    opacity: 0.4;
    transition: var(--transition);
}

.status-step.active {
    opacity: 1;
    border-color: var(--swiss-red);
    box-shadow: 0 0 20px rgba(213, 43, 30, 0.1);
}

.status-step.done {
    opacity: 1;
    border-color: var(--green);
}

.step-icon { font-size: 22px; flex-shrink: 0; }
.step-info { display: flex; flex-direction: column; gap: 2px; }
.step-info strong { font-size: 14px; }
.step-time { font-size: 12px; color: var(--text-muted); }

.result-url { margin-top: 24px; text-align: center; }

.result-url a {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    text-decoration: none;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    transition: var(--transition);
}

.result-url a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(213, 43, 30, 0.3);
}

/* Login Prompt */
.login-prompt {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.login-prompt p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.login-form {
    display: flex;
    gap: 10px;
}

.login-form input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    outline: none;
}

.login-form input:focus {
    border-color: var(--swiss-red);
    box-shadow: 0 0 0 3px rgba(213, 43, 30, 0.1);
}

/* === FOOTER === */
.footer {
    padding: 24px 0 60px; /* extra padding fuer cookie banner */
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.footer-legal {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.6;
}

.footer-legal a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-legal a:hover { text-decoration: underline; }

.footer-links {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover { color: var(--text-secondary); }
.footer-sep { opacity: 0.3; }

.footer-bottom {
    font-size: 12px;
    color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero { padding: 24px 0 20px; }
    .logo-text h1 { font-size: 22px; }
    .logo-icon svg { width: 42px; height: 42px; }
    .hero-desc { font-size: 14px; }
    .chat-container { height: 70vh; border-radius: var(--radius-lg); }
    .chat-header { padding: 12px 16px; }
    .chat-messages { padding: 16px; gap: 16px; }
    .message { max-width: 92%; }
    .message-content { padding: 12px 14px; font-size: 13px; }
    .chat-input-area { padding: 12px 16px 16px; }
    .status-card { padding: 24px 20px; border-radius: var(--radius-lg); }
    .footer-links { flex-wrap: wrap; gap: 8px; }
    .cookie-content { flex-direction: column; text-align: center; }
    .login-form { flex-direction: column; }
}

@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .logo { gap: 12px; }
    .logo-text h1 { font-size: 20px; }
    .tagline { font-size: 11px; letter-spacing: 1.5px; }
    .chat-container { height: 75vh; border-radius: var(--radius-md); }
    .message-avatar { width: 28px; height: 28px; }
    .message-avatar svg { width: 28px; height: 28px; }
    .submit-banner-content { flex-wrap: wrap; font-size: 13px; }
    .btn-submit { width: 100%; text-align: center; margin-left: 0; margin-top: 8px; }
    .btn-submit.btn-secondary { margin-left: 0; }
}

/* === UTILITY === */
.loading-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--swiss-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* === TOAST === */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px; border-radius: 12px; font-size: 14px; font-weight: 500;
    z-index: 2000; transition: transform 0.3s ease; max-width: 90%; text-align: center;
    font-family: var(--font);
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(52,211,153,0.95); color: #0f0f13; }
.toast.error { background: rgba(239,68,68,0.95); color: white; }
.toast.info { background: rgba(74,158,255,0.95); color: white; }
