/*
 * Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
  =====================
  V-Start Application
  ====================
*/

/* --- CSS Variables for Light & Dark Themes --- */
:root {
    /* Light Theme */
    --primary-color: #4f46e5; /* Indigo */
    --secondary-color: #10b981; /* Emerald */
    --background-color: #f1f5f9; /* Slate 100 */
    --text-primary: #1e293b; /* Slate 800 */
    --text-secondary: #64748b; /* Slate 500 */
    --card-background: rgba(255, 255, 255, 0.9);
    --card-border: #e2e8f0; /* Slate 200 */
    --input-background: #f8fafc; /* Slate 50 */
    --input-border: #cbd5e1; /* Slate 300 */
    --hover-background: #f1f5f9; /* Slate 100 */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark Theme */
.dark {
    --primary-color: #6366f1; /* Indigo 500 */
    --secondary-color: #34d399; /* Emerald 400 */
    --background-color: #0f172a; /* Slate 900 */
    --text-primary: #f1f5f9; /* Slate 100 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --card-background: rgba(30, 41, 59, 0.9); /* Slate 800 with opacity */
    --card-border: #334155; /* Slate 700 */
    --input-background: #1e293b; /* Slate 800 */
    --input-border: #475569; /* Slate 600 */
    --hover-background: #1e293b; /* Slate 800 */
}

/* --- Base & Body Styles --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Enhanced Header --- */
#main-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
}

.dark #main-header {
    background: linear-gradient(135deg, #111827 0%, #000000 100%);
}

#main-header h1 {
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}


/* --- Main Container --- */
main {
    padding: 2rem 1rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Navigation Tabs --- */
nav {
    background: var(--card-background);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.main-tab {
    transition: all 0.3s ease;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid transparent;
}

.main-tab:hover {
    background-color: var(--hover-background);
    color: var(--primary-color);
    transform: translateX(4px);
    border-color: var(--primary-color);
}

.main-tab-active {
    background-color: var(--primary-color);
    color: white !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
}

.main-tab-active:hover {
    color: white !important;
    transform: translateX(0);
    background-color: var(--primary-color);
}

/* --- Section Headers --- */
h3, h4 {
    position: relative;
    color: var(--text-primary);
}

h3::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* --- General Overrides for Tailwind Classes --- */
.bg-white {
    background: var(--card-background) !important;
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
}

.border-gray-200 { border-color: var(--card-border) !important; }
.border-gray-300 { border-color: var(--input-border) !important; }
.text-gray-600 { color: var(--text-secondary) !important; }
.text-gray-700 { color: var(--text-primary) !important; }
.text-gray-800 { color: var(--text-primary) !important; }
.bg-gray-50 { background-color: var(--input-background) !important; }
.bg-gray-100 { background-color: var(--hover-background) !important; }

/* --- Buttons --- */
button:active {
    transform: scale(0.97);
}

/* --- Notification Toast --- */
#notification-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translate(-50%, 10px);
    padding: 12px 24px;
    border-radius: 9999px;
    color: white;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    box-shadow: var(--shadow-lg);
}

#notification-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

#notification-toast.success { background-color: #10b981; }
#notification-toast.error { background-color: #ef4444; }
#notification-toast.info { background-color: #3b82f6; }

/* --- Scrollbars --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--input-background);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* --- Accessibility --- */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Responsive Video Container --- */
.video-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.video-container iframe,
.video-container video {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* --- Dark Mode Specific Adjustments --- */
.dark img {
    opacity: 0.9;
}
.dark img:hover {
    opacity: 1;
}

/* --- Mobile Responsive Improvements --- */
@media (max-width: 768px) {
    .main-tab {
        justify-content: center;
    }
    .main-tab span {
        display: none;
    }
    .main-tab svg {
        margin: 0;
    }
}