/* css/style.css */

/* Global Variables - Defines your color palette, fonts, etc. */
:root {
    --primary-color: #00ffff; /* Neon Cyan */
    --secondary-color: #00ff00; /* Neon Green */
    --background-color: #2a2a2a; /* Dark Gray background */
    --card-background: #1e1e1e; /* Slightly lighter dark gray for cards/containers */
    --text-color: #ffffff;     /* White text */
    --subtle-text-color: #cccccc; /* Lighter gray for secondary text */
    --border-color: #00ffff;   /* Neon Cyan border */
    --shadow-color: rgba(0, 255, 255, 0.4); /* Neon Cyan shadow */
    --hover-shadow-color: rgba(0, 255, 0, 0.4); /* Neon Green hover shadow */
    --error-color: #ff6347;   /* Tomato Red for errors */
    --success-color: #4CAF50; /* Green for success */

    /* Font family */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-code: 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace;
}

/* Global Reset & Body Styles */
body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensures footer sticks to the bottom */
    scroll-behavior: smooth; /* Smooth scrolling for anchors */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Header Styling */
header {
    background-color: rgba(30, 30, 30, 0.9); /* Darker, slightly transparent header */
    color: var(--primary-color);
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 15px var(--shadow-color); /* Enhanced shadow */
    backdrop-filter: blur(8px); /* Glassmorphism effect */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.5rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-shadow: 0 0 8px var(--primary-color), 0 0 15px var(--secondary-color); /* Stronger glow */
    cursor: pointer;
    transition: text-shadow 0.3s ease;
}
.logo:hover {
    text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--secondary-color); /* Brighter glow on hover */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    position: relative;
    padding-bottom: 5px; /* Space for the underline */
}

nav ul li a::after { /* Neon underline effect on hover */
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px; /* Position below text */
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px var(--secondary-color); /* Neon glow for underline */
}

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

nav ul li a:hover::after {
    width: 100%;
}

/* Main Content Area */
main {
    flex: 1;
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 20px auto 0 auto; /* Adjusted top margin for sticky header */
    width: 100%;
    box-sizing: border-box;
}

.content-container {
    background-color: var(--card-background);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 25px var(--shadow-color), 0 0 15px var(--border-color); /* Deeper, multi-layered shadow */
    margin-top: 20px;
    border: 1px solid rgba(0, 255, 255, 0.3); /* Subtle neon border */
}

h1, h2, h3 {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--secondary-color); /* Combined neon glow */
    margin-bottom: 1.2rem;
    letter-spacing: 0.5px; /* Slight letter spacing */
}

/* Title Bottom Color (Example for section titles) */
h1, h2, h3 {
    position: relative;
    padding-bottom: 10px; /* Space for the underline */
}
h1::after, h2::after, h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px; /* Underline width */
    height: 3px; /* Underline thickness */
    background-color: var(--border-color); /* Border color used for underline */
    border-radius: 2px;
    box-shadow: 0 0 10px var(--border-color);
}


/* Loading Spinner & Container */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh; /* Full viewport height */
    background: linear-gradient(135deg, var(--background-color) 80%, rgba(10, 10, 10, 0.9) 100%); /* Gradient background */
    color: var(--text-color);
    z-index: 9999; /* Ensure it's on top of everything */
    position: fixed; /* Cover the whole screen */
    top: 0;
    left: 0;
    width: 100%;
    transition: opacity 0.5s ease-out; /* Smooth fade out effect if JS manages it */
}

.loading-container .spinner {
    border: 5px solid rgba(0, 255, 255, 0.2); /* Thicker, semi-transparent border */
    border-radius: 50%;
    border-top: 5px solid var(--primary-color); /* Top border is primary color */
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px var(--primary-color); /* Inner glow */
    margin-bottom: 1rem; /* Space below spinner */
}

.loading-container .loading-text {
    font-size: 1.8rem; /* Larger text size */
    font-weight: bold;
    letter-spacing: 1.5px;
    color: var(--primary-color); /* Neon primary color for text */
    text-align: center;
    text-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--secondary-color); /* Neon glow */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Buttons */
.btn-primary {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%); /* Gradient button */
    color: var(--background-color); /* Dark text on gradient */
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.4s ease;
    box-shadow: 0 0 8px var(--primary-color), 0 0 15px var(--secondary-color); /* Strong button glow */
    letter-spacing: 1px;
}

.btn-primary:hover {
    box-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--secondary-color); /* Brighter glow on hover */
    transform: translateY(-3px); /* Slight lift on hover */
}

.btn-icon {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 1.8rem;
    cursor: pointer;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    padding: 8px;
}

.btn-icon:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 10px var(--secondary-color);
}

/* Mobile Menu Toggle Icon */
.menu-icon {
    display: none; /* Hidden on larger screens by default */
}
.menu-icon:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 8px var(--secondary-color);
}

/* Responsive Adjustments for Global Elements */
@media (max-width: 768px) {
    /* Header Adjustments */
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
    }
    .logo {
        font-size: 1.6rem;
    }
    nav ul {
        margin-top: 10px;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    nav ul li {
        margin-left: 0;
        margin-bottom: 15px;
        width: 100%;
        text-align: center;
    }
    nav ul li a {
        display: block;
        padding: 10px 0;
    }
    .menu-icon {
        display: block; /* Show menu icon on mobile */
        margin-top: 10px;
    }
    nav ul:not(.active) {
        display: none; /* Hide menu items when not active */
    }
    nav ul.active {
        display: flex; /* Show menu items when active */
    }

    /* Main Content Padding */
    main {
        padding: 1.5rem 1rem;
    }
}

/* --- Component Specific Styles --- */

/* Auth Pages Styles */
.auth-container {
    background-color: var(--card-background);
    padding: 3rem 3.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px var(--shadow-color), 0 0 20px rgba(0, 255, 0, 0.4); /* Combined Neon Shadows */
    text-align: center;
    width: 90%;
    max-width: 450px;
    margin: 80px auto;
    border: 1px solid rgba(0, 255, 255, 0.4); /* Neon border */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.auth-container .app-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 1.5rem;
    background-color: #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}
.auth-container .logo-char {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-color);
}

.auth-container h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
    color: var(--text-color);
    text-shadow: 0 0 10px var(--primary-color);
}

.auth-container p {
    color: var(--subtle-text-color);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.7rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.1rem;
}

.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 14px 18px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    border: 1px solid rgba(0, 255, 255, 0.4);
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1.1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px var(--secondary-color);
}

.auth-container .btn-primary {
    margin-top: 1rem;
    width: 100%;
    font-weight: bold;
    letter-spacing: 0.5px;
    background: var(--text-color);
    color: var(--background-color);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    border: 2px solid var(--primary-color);
}

.auth-container .btn-primary:hover {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--background-color);
    box-shadow: 0 0 15px var(--primary-color), 0 0 25px var(--secondary-color);
    transform: translateY(-3px);
}

.auth-links {
    margin-top: 2rem;
    font-size: 0.98rem;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-links p {
    margin-bottom: 0;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    padding: 0 5px;
}

.auth-links a:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 8px var(--secondary-color);
}

/* Error and Success Messages */
.error-message {
    color: var(--error-color);
    margin-top: 15px;
    font-size: 0.95rem;
    text-align: left;
    font-weight: bold;
    width: 100%;
}

.success-message {
    color: var(--success-color);
    margin-top: 15px;
    font-size: 0.95rem;
    text-align: left;
    font-weight: bold;
    width: 100%;
}

/* Responsive Adjustments for Auth Pages */
@media (max-width: 768px) {
    .auth-container {
        margin: 30px auto;
        padding: 1.8rem;
        width: 95%;
    }
    .auth-container h1 {
        font-size: 2.2rem;
    }
    .auth-container p {
        font-size: 0.9rem;
    }
    .form-group {
        margin-bottom: 1rem;
    }
    .form-group input {
        padding: 10px 12px;
        font-size: 1rem;
    }
    .auth-container .btn-primary {
        padding: 10px 20px;
        font-size: 1rem;
    }
    .auth-links {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 5px;
    }
    .auth-links p {
        margin-bottom: 0.5rem;
    }
}

/* Chat Interface Specific Styles */
.chat-main-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px); /* Adjust based on header/footer height */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 5px 25px var(--shadow-color), 0 0 15px var(--border-color);
    background-color: var(--card-background);
    overflow: hidden;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

/* Chat Messages Area */
.chat-messages-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 18px; /* Space between messages */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--background-color);
}

/* Scrollbar for Webkit browsers (Chrome, Safari) */
.chat-messages-area::-webkit-scrollbar {
    width: 8px;
}
.chat-messages-area::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 10px;
}
.chat-messages-area::-webkit-scrollbar-thumb {
    background-color: var(--primary-color);
    border-radius: 10px;
    border: 2px solid var(--background-color);
}
.chat-messages-area::-webkit-scrollbar-thumb:hover {
    background-color: var(--secondary-color);
}

/* Individual Message Bubble */
.message {
    padding: 12px 18px;
    border-radius: 10px;
    max-width: 75%;
    word-wrap: break-word;
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease-in-out;
}
.message:hover {
    transform: scale(1.01);
}

.user-message {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--background-color);
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 0 15px var(--primary-color); /* User message glow */
}

.bot-message {
    background-color: var(--card-background);
    color: var(--text-color);
    border: 1px solid rgba(0, 255, 255, 0.3);
    align-self: flex-start;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3); /* Bot message glow */
}

.bot-message.error {
    background-color: var(--error-color);
    border-color: var(--error-color);
    color: var(--text-color);
    box-shadow: 0 0 15px var(--error-color); /* Error message glow */
}

/* Bot Thinking Indicator */
.bot-thinking {
    display: flex;
    align-items: center;
    gap: 12px;
    font-style: italic;
    color: var(--subtle-text-color);
    padding: 10px 15px;
    border-radius: 10px;
    background-color: rgba(26, 26, 26, 0.7);
    border: 1px solid rgba(0, 255, 255, 0.1);
}

.thinking-animation {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid var(--primary-color);
    width: 24px;
    height: 24px;
    animation: spin-small 1s linear infinite;
}

@keyframes spin-small {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Image/Video Preview Styling */
.chat-image-preview, .chat-video-preview {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 5px 0;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}
.chat-image-preview:hover, .chat-video-preview:hover {
    transform: scale(1.05);
}

/* Code Styling */
pre {
    background-color: var(--card-background); /* Match card background */
    color: var(--text-color);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: var(--font-code);
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.3); /* Inner neon glow */
}

code {
    font-family: inherit;
}

/* Basic Syntax Highlighting (can be enhanced with Prism.js) */
.token.keyword { color: #00ffff; font-weight: bold; }
.token.string { color: #00ff00; }
.token.comment { color: #888; font-style: italic; }
.token.number { color: #ff6347; }
.token.function { color: #ffff00; }

/* Mobile Menu Toggle Icon */
.menu-icon {
    display: none; /* Hidden on larger screens by default */
}
.menu-icon:hover {
    color: var(--secondary-color);
    text-shadow: 0 0 8px var(--secondary-color);
}

/* Responsive Adjustments for Global Elements */
@media (max-width: 768px) {
    /* Header Adjustments */
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 0 1rem;
    }
    .logo {
        font-size: 1.6rem;
    }
    nav ul {
        margin-top: 10px;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    nav ul li {
        margin-left: 0;
        margin-bottom: 15px;
        width: 100%;
        text-align: center;
    }
    nav ul li a {
        display: block;
        padding: 10px 0;
    }
    .menu-icon {
        display: block; /* Show menu icon on mobile */
        margin-top: 10px;
    }
    nav ul:not(.active) {
        display: none; /* Hide menu items when not active */
    }
    nav ul.active {
        display: flex; /* Show menu items when active */
    }

    /* Main Content Padding */
    main {
        padding: 1.5rem 1rem;
    }
        }
