/* --- Global Styles & Variables --- */
:root {
    --primary-color: #00E5FF; /* Vibrant Cyan */
    --primary-glow: rgba(0, 229, 255, 0.3);
    --background-color: #0A192F; /* Deep Navy */
    --card-background: rgba(16, 36, 66, 0.6);
    --header-background: rgba(10, 25, 47, 0.85);
    --text-color: #CCD6F6;
    --heading-color: #E6F1FF;
    --border-color: rgba(0, 229, 255, 0.2);
    --font-family: 'Poppins', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-family); background-color: var(--background-color); color: var(--text-color); line-height: 1.7; overflow-x: hidden; }
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--background-color); }
::-webkit-scrollbar-thumb { background: #102442; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* --- Header & Navigation --- */
header { position: sticky; top: 0; width: 100%; padding: 1.5rem 0; z-index: 100; transition: background-color 0.4s ease, backdrop-filter 0.4s ease, padding 0.4s ease; background-color: var(--header-background); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 2px 20px rgba(0,0,0,0.2); }
nav { display: flex; justify-content: space-between; align-items: center; }
.logo-link { display: flex; align-items: center; text-decoration: none; color: var(--heading-color); font-size: 1.5rem; font-weight: 600; }
.logo { height: 40px; margin-right: 10px; transition: transform 0.3s ease; }
.logo-link:hover .logo { transform: rotate(-10deg); }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { color: var(--text-color); text-decoration: none; font-weight: 500; position: relative; transition: color 0.3s ease; }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 50%; transform: translateX(-50%); background-color: var(--primary-color); transition: width 0.3s ease; }
.nav-links a:hover { color: var(--heading-color); }
.nav-links a:hover::after { width: 100%; }

/* --- Buttons --- */
.btn { padding: 0.75rem 1.75rem; border: none; border-radius: 50px; font-weight: 600; cursor: pointer; transition: all 0.3s ease; font-size: 1rem; text-decoration: none; display: inline-block; }
.btn-primary { background-color: var(--primary-color); color: #0A192F; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.btn-primary:hover { transform: translateY(-4px); box-shadow: 0 6px 20px var(--primary-glow); }
.btn-secondary { background-color: transparent; color: #fff; border: 2px solid var(--border-color); }
.btn-secondary:hover { background-color: var(--primary-color); border-color: var(--primary-color); color: #0A192F; }

/* --- Hero Section --- */
.hero { height: 90vh; display: flex; align-items: center; justify-content: center; text-align: center; position: relative; overflow: hidden; padding: 0 1rem; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; width: 200%; height: 200%; background: radial-gradient(circle at 30% 70%, rgba(0, 229, 255, 0.08), var(--background-color) 35%), radial-gradient(circle at 70% 30%, rgba(16, 36, 66, 0.5), var(--background-color) 35%); animation: background-pan 30s infinite linear; z-index: -1; }
@keyframes background-pan { 0% { transform: translate(0%, 0%); } 25% { transform: translate(-20%, 10%); } 50% { transform: translate(0%, 20%); } 75% { transform: translate(20%, -10%); } 100% { transform: translate(0%, 0%); } }
.hero-content { max-width: 800px; }
.hero-content h1 { font-size: 3.8rem; font-weight: 700; color: var(--heading-color); margin-bottom: 1rem; line-height: 1.2; text-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.hero-content p { font-size: 1.25rem; max-width: 600px; margin: 0 auto 2.5rem; }
.hero-buttons { display: flex; justify-content: center; gap: 1.5rem; }

/* --- Benefits Section & Cards --- */
.benefits { padding: 6rem 0; text-align: center; }
.section-title { font-size: 2.8rem; margin-bottom: 1rem; color: var(--heading-color); }
.section-subtitle { font-size: 1.15rem; max-width: 600px; margin: 0 auto 4rem; }
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; justify-content: center; }
.card { background-color: var(--card-background); padding: 2.5rem 2rem; border-radius: 12px; border: 1px solid transparent; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease; }
.card:hover { transform: translateY(-8px); border-color: var(--border-color); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3); }
.card-icon { margin-bottom: 1.5rem; }
.card-icon svg { width: 48px; height: 48px; color: var(--primary-color); }
.card h3 { font-size: 1.5rem; margin-bottom: 0.75rem; color: var(--heading-color); }

/* --- Footer --- */
footer { padding: 3rem 0; background-color: #061224; border-top: 1px solid var(--border-color); }
.footer-content { display: flex; justify-content: space-between; align-items: center; }
.footer-links a { color: var(--text-color); text-decoration: none; margin-right: 1.5rem; transition: color 0.3s ease; }
.footer-links a:hover { color: var(--primary-color); }

/* --- Popups (Auth & Confirm) --- */
.popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: none; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.popup-content { background: var(--header-background); padding: 2.5rem; border-radius: 12px; width: 90%; max-width: 500px; position: relative; border: 1px solid var(--border-color); animation: pop-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 10px 40px rgba(0,0,0,0.3); text-align: center; }
.popup-content h2 { color: var(--heading-color); margin-bottom: 1rem; }
.close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2rem; color: var(--text-color); cursor: pointer; transition: transform 0.3s ease, color 0.3s ease; }
.close-btn:hover { color: var(--primary-color); transform: rotate(90deg); }
.confirm-buttons { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; }


/* --- Animations --- */
@keyframes pop-in { from { opacity: 0; transform: scale(0.8) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.fade-in { opacity: 0; animation: fadeIn 1s ease-out forwards; }
.fade-in-delay { opacity: 0; animation: fadeIn 1s 0.3s ease-out forwards; }
.fade-in-delay-2 { opacity: 0; animation: fadeIn 1s 0.6s ease-out forwards; }
@keyframes fadeIn { to { opacity: 1; } }
.animate-on-scroll { opacity: 0; transform: translateY(40px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
.card.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.card.animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.card.animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-content p { font-size: 1rem; }
    .hero-buttons { flex-direction: column; gap: 1rem; }
    .footer-content { flex-direction: column; gap: 1rem; text-align: center; }
}

/* --- Popup Form Styles --- */
.auth-form h2 { color: var(--heading-color); margin-bottom: 0.5rem; text-align: center; }
.auth-form p { text-align: center; margin-bottom: 2rem; font-size: 0.95rem; }
.input-group { margin-bottom: 1rem; }
.input-group input { width: 100%; padding: 0.8rem 1rem; background-color: #0A192F; border: 1px solid var(--border-color); border-radius: 8px; color: var(--text-color); font-size: 1rem; transition: border-color 0.3s ease, box-shadow 0.3s ease; }
.input-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }
.form-btn { width: 100%; padding: 0.9rem; margin-top: 1rem; font-size: 1.1rem; }
.form-toggle-text { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }
.form-toggle-text a { color: var(--primary-color); font-weight: 600; text-decoration: none; }
.form-message { text-align: center; margin-top: 1rem; padding: 0.75rem; border-radius: 8px; min-height: 50px; display: flex; align-items: center; justify-content: center; transition: opacity 0.3s ease; }
.form-message:not(:empty) { opacity: 1; }
.form-message.success { background-color: rgba(0, 229, 255, 0.1); color: var(--primary-color); }
.form-message.error { background-color: rgba(255, 77, 77, 0.1); color: #ff4d4d; }

.terms-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    font-size: 0.85rem;
    text-align: left;
    color: var(--text-color);
}
.terms-group input[type="checkbox"] {
    width: auto; /* Override default width */
    height: 16px;
    width: 16px;
    flex-shrink: 0;
    accent-color: var(--primary-color);
}
.terms-group a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.terms-group a:hover {
    text-decoration: underline;
}

.form-btn:disabled {
    background-color: #3d4a5f;
    color: #8b9cc1;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}


/* --- Verification Code Inputs --- */
.code-inputs { display: flex; justify-content: center; gap: 10px; margin: 2rem 0; }
.code-input { width: 45px; height: 55px; font-size: 1.5rem; text-align: center; border-radius: 8px; border: 1px solid var(--border-color); background-color: #0A192F; color: var(--text-color); }
.code-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px var(--primary-glow); }

/* --- User Dropdown --- */
.auth-buttons { position: relative; }
.user-dropdown .dropdown-toggle { background: transparent; border: 1px solid var(--border-color); color: var(--text-color); padding: 0.6rem 1.2rem; border-radius: 50px; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }
.user-dropdown .dropdown-toggle .chevron { width: 16px; height: 16px; transition: transform 0.3s ease; }
.user-dropdown .dropdown-toggle:hover { background-color: var(--card-background); }
.user-dropdown .dropdown-menu { display: none; position: absolute; top: 120%; right: 0; background-color: var(--header-background); border: 1px solid var(--border-color); border-radius: 8px; padding: 0.5rem; min-width: 150px; box-shadow: 0 5px 20px rgba(0,0,0,0.3); }
.user-dropdown .dropdown-menu a { display: block; color: var(--text-color); padding: 0.75rem 1rem; text-decoration: none; border-radius: 6px; }
.user-dropdown .dropdown-menu a:hover { background-color: var(--card-background); color: var(--primary-color); }

/* --- Light Mode Theme --- */
body.light-mode {
    --background-color: #F0F2F5;       /* Light Gray */
    --card-background: #FFFFFF;           /* White */
    --header-background: rgba(255, 255, 255, 0.85);
    --text-color: #333742;                /* Dark Gray */
    --heading-color: #000000;              /* Black */
    --border-color: rgba(0, 0, 0, 0.1);
    --primary-glow: rgba(0, 229, 255, 0.4);
}

/* --- Theme Toggle Button --- */
.theme-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
    transition: transform 0.3s ease;
}
.theme-toggle-btn:hover {
    transform: scale(1.1);
}
.theme-toggle-btn svg {
    width: 24px;
    height: 24px;
    color: var(--heading-color);
    transition: color 0.3s ease;
}

/* --- Smooth Transitions --- */
body, .card, header, .popup-content, .input-group input {
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* --- Avatar Placeholders --- */
.chat-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #333;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.avatar-upload .chat-avatar {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

/* --- Live Preview Chat Header --- */
.live-preview .chat-header {
    position: relative;
}

.clear-chat-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Live Preview Send Button --- */
#preview-chat-form button svg {
    color: var(--primary-color);
}

/* --- Textarea Styling --- */
#embed-snippet {
    width: 100%;
    background-color: #0A192F;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    padding: 0.5rem;
    font-family: monospace;
    resize: none;
}

/* --- Footer Logout Link --- */
.logout-link {
    color: #ff4d4d; /* A clear red color */
    font-weight: 600;
    text-decoration: none;
    background-color: rgba(255, 77, 77, 0.1); /* A subtle red background */
    padding: 5px 12px;
    border-radius: 50px;
    border: 1px solid rgba(255, 77, 77, 0.3);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.logout-link:hover {
    background-color: #ff4d4d;
    color: #fff;
}

#demo-video-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right:0; bottom:0;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#demo-video-overlay .popup-content {
  background: #151515;
  padding: 20px;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  text-align: center;
}
