/* =============================================================================
 * Landing / Login Shared Styles — RAG Chatbot System
 * =============================================================================
 * Animated mesh gradient background, glassmorphism cards, form styles.
 * Used by: landing page, chat login page, admin login page.
 * ============================================================================= */

/* ---------------------------------------------------------------------------
   Reset & Base
   --------------------------------------------------------------------------- */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #e0e0e0;
    overflow-x: hidden;
}

/* ---------------------------------------------------------------------------
   Animated Mesh Gradient Background
   Three floating orbs create a living gradient effect.
   --------------------------------------------------------------------------- */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 60%, #16213e 100%);
    overflow: hidden;
}

.animated-bg::before,
.animated-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
}

.animated-bg::before {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(123, 67, 230, 0.35) 0%, transparent 70%);
    top: -20%;
    left: -10%;
    animation: floatOrb1 18s infinite;
}

.animated-bg::after {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.3) 0%, transparent 70%);
    bottom: -15%;
    right: -5%;
    animation: floatOrb2 22s infinite;
}

/* Third orb via an extra element in HTML */
.animated-bg .orb-3 {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 107, 157, 0.25) 0%, transparent 70%);
    filter: blur(100px);
    top: 40%;
    left: 50%;
    animation: floatOrb3 20s infinite;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(80px, 60px) scale(1.1); }
    50%  { transform: translate(40px, -30px) scale(0.9); }
    75%  { transform: translate(-30px, 20px) scale(1.05); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(-60px, -40px) scale(1.15); }
    66%  { transform: translate(-20px, 50px) scale(0.85); }
}

@keyframes floatOrb3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    20%  { transform: translate(-40%, -60%) scale(1.2); }
    50%  { transform: translate(-60%, -40%) scale(0.9); }
    80%  { transform: translate(-55%, -45%) scale(1.1); }
}

/* ---------------------------------------------------------------------------
   Page Layout
   --------------------------------------------------------------------------- */
.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.page-inner {
    width: 100%;
    max-width: 900px;
    text-align: center;
}

/* ---------------------------------------------------------------------------
   Typography
   --------------------------------------------------------------------------- */
.hero-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    display: block;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #a78bfa, #67e8f9, #f472b6);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* ---------------------------------------------------------------------------
   Glass Card
   --------------------------------------------------------------------------- */
.glass-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(circle at top left, rgba(123, 67, 230, 0.08), transparent 60%);
    pointer-events: none;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35), 0 0 60px rgba(123, 67, 230, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

/* ---------------------------------------------------------------------------
   Cards Row (Landing page only)
   --------------------------------------------------------------------------- */
.cards-row {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cards-row .card-link {
    flex: 1;
    min-width: 260px;
    max-width: 360px;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-link .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.card-link:hover .card-icon {
    transform: scale(1.15);
}

.card-link .card-heading {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #f1f5f9;
}

.card-link .card-text {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Card accent borders */
.card-link.chat-card .glass-card {
    border-top: 3px solid rgba(167, 139, 250, 0.5);
}

.card-link.admin-card .glass-card {
    border-top: 3px solid rgba(0, 180, 216, 0.5);
}

/* ---------------------------------------------------------------------------
   Glow Button
   --------------------------------------------------------------------------- */
.glow-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.3s ease;
    position: relative;
    z-index: 1;
}

.glow-btn:hover {
    transform: translateY(-2px);
}

.glow-btn:active {
    transform: scale(0.97);
}

.glow-btn.chat-btn {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.glow-btn.chat-btn:hover {
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.55);
}

.glow-btn.admin-btn {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
    color: #0f172a;
    box-shadow: 0 4px 20px rgba(8, 145, 178, 0.35);
}

.glow-btn.admin-btn:hover {
    box-shadow: 0 8px 32px rgba(8, 145, 178, 0.55);
}

/* ---------------------------------------------------------------------------
   Login Form (inside glass card)
   --------------------------------------------------------------------------- */
.login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-container .glass-card {
    text-align: left;
}

.login-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, #a78bfa, #67e8f9);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 6s ease-in-out infinite;
}

.login-card-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1.5rem;
}

/* Form elements inside glass */
.glass-card .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 0.35rem;
    display: block;
}

.glass-card .form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #f1f5f9;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.glass-card .form-control::placeholder {
    color: #475569;
}

.glass-card .form-control:focus {
    border-color: #a78bfa;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.glass-card .mb-3 {
    margin-bottom: 1rem;
}

/* Alert inside glass */
.glass-card .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

/* Submit button in forms */
.glass-card .btn-primary {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.glass-card .btn-primary:hover {
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}

.glass-card .btn-primary:active {
    transform: scale(0.97);
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.page-footer {
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.8rem;
    }
    .hero-subtitle {
        font-size: 0.95rem;
    }
    .hero-icon {
        font-size: 3rem;
    }
    .cards-row {
        flex-direction: column;
        align-items: center;
    }
    .cards-row .card-link {
        max-width: 100%;
    }
    .glass-card {
        padding: 1.5rem;
    }
    .login-container {
        max-width: 100%;
    }
}