/* ============================================
   AI SIMULATOR - UNIFIED STYLES
   All styles in one file for optimal performance
   ============================================ */

/* === CSS VARIABLES === */
:root {
    /* Colors */
    --bg-primary: #1a1d29;
    --bg-secondary: #23273a;
    --bg-tertiary: #2d3250;
    --bg-card: #2a2f45;
    --bg-hover: #353b54;

    --text-primary: #e8eaed;
    --text-secondary: #b8bcc8;
    --text-muted: #8b92a8;

    --accent-primary: #6366f1;
    --accent-primary-hover: #4f46e5;
    --accent-secondary: #22d3ee;
    --accent-purple: #a855f7;
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;

    --border-color: #3d4358;
    --border-light: #4a5070;

    --navbar-height: 60px;

    /* Gradient definitions */
    --gradient-primary: linear-gradient(135deg, #a855f7 0%, #06b6d4 100%);
    --gradient-primary-reverse: linear-gradient(135deg, #06b6d4 0%, #a855f7 100%);
    --gradient-purple: linear-gradient(to bottom right, #a855f7, #9333ea);
    --gradient-cyan: linear-gradient(to bottom right, #06b6d4, #0891b2);
    --gradient-pink: linear-gradient(to bottom right, #ec4899, #a855f7);

    /* Shadow definitions */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow-purple: 0 8px 24px rgba(168, 85, 247, 0.5);
    --shadow-glow-cyan: 0 8px 24px rgba(6, 182, 212, 0.5);
}

/* === BASE STYLES === */
html, body {
    height: 100%;
    margin: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1 0 auto;
}

.content-wrapper .container {
    max-width: 1600px;
    padding: 0 20px;
    margin: 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* === NAVBAR === */
.navbar {
    background-color: var(--bg-secondary) !important;
    border-bottom: 2px solid var(--accent-primary);
    min-height: var(--navbar-height);
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.navbar .container-fluid {
    padding: 0 20px;
    min-height: var(--navbar-height);
    align-items: stretch;
}

.navbar-brand {
    font-size: 1.25rem;
    color: var(--text-primary) !important;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: var(--navbar-height);
    margin: 0 !important;
    transition: all 0.2s;
}

.navbar-brand strong {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.navbar-brand:hover {
    background-color: var(--bg-hover);
}

.navbar-brand:hover strong {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    color: var(--text-secondary) !important;
    padding: 0 20px !important;
    height: var(--navbar-height);
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    border-right: 1px solid var(--border-color);
    transition: all 0.2s;
    font-weight: 500;
    min-width: 140px;
    justify-content: center;
}

.nav-link .nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: var(--bg-hover);
    color: var(--accent-secondary) !important;
}

.nav-link:hover .nav-icon {
    transform: scale(1.1);
}

.nav-link.active {
    font-weight: bold;
    background-color: var(--bg-tertiary);
    color: var(--accent-primary) !important;
    border-bottom: 3px solid var(--accent-primary);
}

.nav-link.active .nav-icon {
    color: var(--accent-primary);
}

/* Vertical alignment for navbar items */
.navbar-nav {
    align-items: stretch;
    margin: 0;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: stretch;
    margin: 0;
}

.navbar-text {
    margin-bottom: 0;
    line-height: var(--navbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: var(--text-primary) !important;
    height: var(--navbar-height);
}

/* Base styles for containers that load content */
#history, #templatesList {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.navbar-text .badge {
    margin-left: 12px;
    background-color: var(--accent-warning) !important;
    color: var(--bg-primary) !important;
    padding: 4px 10px;
    font-size: 0.75rem;
    vertical-align: middle;
}

/* Align buttons in navbar */
.navbar .btn {
    margin: 12px 0;
    height: 36px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border: 2px solid var(--accent-primary);
    background-color: transparent;
    color: var(--accent-primary);
    font-weight: 600;
    transition: all 0.2s;
    min-width: 140px;
    justify-content: center;
}

.navbar .btn:hover {
    background-color: var(--accent-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.navbar .btn-outline-light {
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
}

.navbar .btn-outline-light:hover {
    background-color: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: var(--bg-primary);
}

.logout-btn {
    border-color: var(--accent-danger) !important;
    color: var(--accent-danger) !important;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background-color: var(--accent-danger) !important;
    border-color: var(--accent-danger) !important;
    color: white !important;
}

/* Align the right side elements */
.ms-auto {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-left: auto;
}

.navbar-toggler {
    border-color: var(--border-light);
}

.navbar-toggler-icon {
    filter: brightness(0) invert(1);
}

.navbar-collapse {
    align-items: stretch;
    margin: 0 !important;
}

/* === FOOTER === */
.footer {
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background: linear-gradient(to bottom, var(--bg-secondary), var(--bg-primary));
    color: var(--text-muted);
    width: 100%;
}

.footer h6 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-link:hover {
    color: var(--accent-primary);
    transform: translateX(4px);
}

.footer-social-link {
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background: var(--bg-tertiary);
}

.footer-social-link:hover {
    color: white;
    background: var(--accent-primary);
    transform: translateY(-2px);
}

.footer .list-unstyled {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* === CARDS === */
.card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-primary);
}

.card-header {
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.card-body {
    background-color: var(--bg-card);
}

.glass-effect {
    background: rgba(42, 47, 69, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

.enhanced-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.enhanced-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-hover {
    transition: all 0.3s ease;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.card-hover:hover {
    transform: translateY(-8px);
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.3);
}

/* === FORMS === */
.form-label {
    color: var(--text-primary);
    font-weight: 500;
}

.form-control {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.form-control:focus {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea#question {
    font-family: 'Courier New', monospace;
}

.form-check-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.form-check-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

.form-check-label {
    color: var(--text-primary);
}

.form-text {
    color: var(--text-muted);
}

.prompt-wrapper {
    position: relative;
    width: 100%;
}

.prompt-wrapper .form-control {
    padding-right: 45px;
    min-height: 100px;
    resize: vertical;
}

.clear-prompt-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    opacity: 0;
    visibility: hidden;
}

.prompt-wrapper:hover .clear-prompt-btn,
.prompt-wrapper textarea:focus + .clear-prompt-btn {
    opacity: 1;
    visibility: visible;
}

.clear-prompt-btn:hover {
    background-color: var(--accent-danger);
    border-color: var(--accent-danger);
    color: white;
}

#wordCounter {
    margin-top: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#wordCounter.text-success {
    color: var(--accent-success) !important;
}

#wordCounter.text-danger {
    color: var(--accent-danger) !important;
}

#wordCounter.text-muted {
    color: rgba(255, 255, 255, 0.4) !important;
}

#wordCount {
    font-weight: 700;
    font-size: 1rem;
}

/* === BUTTONS === */
.btn-primary {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:focus {
    background-color: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.5);
}

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

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

.btn-outline-primary {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.gradient-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    z-index: 1;
}

.gradient-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary-reverse);
    transition: left 0.3s ease;
    z-index: -1;
}

.gradient-button:hover::before {
    left: 0;
}

.gradient-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.4);
    color: white;
    text-decoration: none;
}

.btn-action {
    width: 90px;
    padding: 6px 0;
    font-weight: 600;
    transition: all 0.2s;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    background-color: var(--accent-primary) !important;
    border: 1px solid var(--accent-primary) !important;
    color: white !important;
}

.btn-edit:hover {
    background-color: var(--accent-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.btn-delete {
    background-color: transparent !important;
    border: 1px solid var(--accent-danger) !important;
    color: var(--accent-danger) !important;
}

.btn-delete:hover {
    background-color: var(--accent-danger) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */

.landing-hero {
    padding: 8rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.landing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.landing-hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.landing-hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    max-width: 45rem;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.landing-input-wrapper {
    max-width: 45rem;
    margin: 0 auto 4rem;
}

.landing-input-container {
    padding: 0.5rem;
    border-radius: 1.25rem;
    box-shadow: var(--shadow-lg);
}

.landing-input-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
}

.landing-icon {
    color: var(--accent-purple);
    flex-shrink: 0;
}

.landing-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    outline: none;
    width: 100%;
}

.landing-generate-btn {
    padding: 0.75rem 1.5rem;
}

.landing-cta-btn {
    padding: 1rem 2.5rem;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.landing-subtext {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.landing-section {
    padding: 6rem 0;
}

.landing-section-header {
    margin-bottom: 4rem;
}

.landing-section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.landing-section-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 42rem;
    margin: 0 auto;
}

.landing-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.landing-card {
    background: rgba(42, 47, 69, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.landing-card-visual {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.landing-visual-solar { background: linear-gradient(135deg, rgba(168, 85, 247, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%); }
.landing-visual-pathfinding { background: linear-gradient(135deg, rgba(6, 182, 212, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%); }
.landing-visual-cyberpunk { background: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%); }

/* Solar System Animation */
.solar-container { position: relative; width: 100%; height: 100%; }
.solar-sun { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; background: #fbbf24; border-radius: 50%; box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); }
.solar-orbit { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border: 1px dashed rgba(255, 255, 255, 0.1); border-radius: 50%; }
.orbit-1 { width: 100px; height: 100px; animation: rotate 10s linear infinite; }
.orbit-2 { width: 160px; height: 160px; animation: rotate 20s linear infinite; }
.solar-planet { position: absolute; border-radius: 50%; }
.planet-1 { top: -5px; left: 50%; width: 10px; height: 10px; background: #60a5fa; }
.planet-2 { top: -8px; left: 50%; width: 16px; height: 16px; background: #f87171; }
@keyframes rotate { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Pathfinding Visualization */
.pathfinding-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 10px; }
.grid-cell { width: 25px; height: 25px; background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.grid-wall { background: var(--bg-tertiary); }
.grid-path { background: var(--accent-cyan); box-shadow: 0 0 10px var(--accent-cyan); }
.grid-end { background: var(--accent-success); box-shadow: 0 0 10px var(--accent-success); }
.grid-pulse { animation: gridPulse 2s infinite; }
@keyframes gridPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* Cyberpunk Visualization */
.cyberpunk-container { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cyberpunk-particle { position: absolute; border-radius: 50%; filter: blur(1px); }
.particle-1 { width: 6px; height: 6px; background: var(--accent-pink); top: 20%; left: 30%; }
.particle-2 { width: 10px; height: 10px; background: var(--accent-purple); top: 60%; right: 20%; animation: float 4s infinite ease-in-out; }
.particle-3 { width: 4px; height: 4px; background: var(--accent-cyan); bottom: 30%; left: 20%; }
.particle-4 { width: 8px; height: 8px; background: var(--accent-pink); top: 30%; right: 40%; animation: float 5s infinite ease-in-out; }
.particle-5 { width: 5px; height: 5px; background: var(--accent-purple); bottom: 20%; right: 50%; }
.cyberpunk-text { font-size: 2rem; font-weight: 800; letter-spacing: 4px; color: white; text-shadow: 0 0 10px var(--accent-pink), 0 0 20px var(--accent-purple); }

.landing-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.landing-card-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.landing-card-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.landing-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.landing-card-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.landing-card-tags {
    margin-top: auto;
    padding-top: 1rem;
    display: flex;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.landing-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
}

.landing-step-card {
    padding: 2.5rem 2rem;
    text-align: center;
    height: 100%;
}

.landing-step-icon {
    margin: 0 auto 1.5rem;
    width: 80px;
    height: 80px;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.step-icon-purple { background: var(--gradient-purple); box-shadow: var(--shadow-glow-purple); }
.step-icon-cyan { background: var(--gradient-cyan); box-shadow: var(--shadow-glow-cyan); }
.step-icon-pink { background: var(--gradient-pink); box-shadow: 0 8px 24px rgba(236, 72, 153, 0.4); }

.landing-step-number {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 1rem;
    color: var(--accent-primary);
}

.landing-step-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.landing-step-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.landing-feature-card {
    padding: 2.5rem 2rem;
}

.landing-feature-icon {
    margin-bottom: 1.5rem;
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.landing-feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.landing-feature-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

.landing-cta-section {
    margin-top: 4rem;
}

.landing-cta-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.landing-cta-secondary {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

.landing-final-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
}

.landing-final-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .landing-hero { padding: 6rem 0 3rem; }
    .landing-hero-title { font-size: 2.5rem; }
    .landing-input-inner { flex-direction: column; padding: 1rem; }
    .landing-generate-btn { width: 100%; justify-content: center; }
    .landing-section { padding: 4rem 0; }
}

/* === UTILITIES === */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.particle-bg {
    background-color: var(--bg-primary);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.15) 0%, transparent 50%);
}

.icon-purple {
    background: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
}

.icon-cyan {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.icon-pink {
    background: rgba(236, 72, 153, 0.2);
    color: var(--accent-pink);
}

.icon-green {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

/* === ANIMATIONS === */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.4); }
    50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.8); }
}

.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

/* === ALERTS & MODALS === */
.alert {
    border: none;
    border-radius: 0.75rem;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    background-color: rgba(34, 211, 238, 0.2);
    color: var(--accent-secondary);
    border: 1px solid rgba(34, 211, 238, 0.3);
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.modal-title {
    color: var(--text-primary);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.8);
}

.btn-close {
    filter: invert(1);
}

/* === MODAL EDIT MODE === */
/* Prompt editor - matches .p-3 div styling */
.modal-body textarea#editPrompt {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    resize: vertical;
    box-sizing: border-box;
}

.modal-body textarea#editPrompt:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

/* HTML editor - matches pre/code styling */
.modal-body textarea#editHtml {
    width: 100%;
    max-height: 60vh;
    min-height: 400px;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    resize: vertical;
    box-sizing: border-box;
}

.modal-body textarea#editHtml:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

/* === BADGES & SPINNERS === */
.badge {
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.bg-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #10b981 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.bg-secondary {
    background-color: rgba(139, 146, 168, 0.15) !important;
    color: #8b92a8 !important;
    border: 1px solid rgba(139, 146, 168, 0.3) !important;
}

.bg-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.spinner-border {
    border-color: var(--accent-primary);
    border-right-color: transparent;
}

/* === TABLES & LISTS === */
.table {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--border-color) !important;
    padding: 12px 15px;
    font-weight: 600;
}

.table tbody td {
    background-color: var(--bg-card) !important;
    color: var(--text-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 12px 15px;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) td {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.table tbody tr:hover td {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* === HISTORY TABLE === */
.history-table-container {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 0.75rem;
}

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.history-table thead {
    background: var(--bg-tertiary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.history-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.history-table th:first-child {
    border-top-left-radius: 0.75rem;
}

.history-table th:last-child {
    border-top-right-radius: 0.75rem;
}

/* Column widths */
.th-id { width: 100px; }
.th-prompt { width: 40%; min-width: 250px; }
.th-response { width: 60px; text-align: center; }
.td-response { text-align: center; }
.th-user { width: 180px; }
.th-example { width: 80px; text-align: center; }
.th-date { width: 150px; }
.th-actions { width: 180px; text-align: center; }

.history-row {
    background: var(--bg-card);
    transition: all 0.2s ease;
}

.history-row:hover {
    background: var(--bg-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.history-row td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* ID Badge */
.id-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.375rem;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: var(--accent-primary);
    cursor: help;
    transition: all 0.2s ease;
}

.id-badge:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: var(--accent-primary);
}

/* Prompt Preview */
.prompt-preview {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1.5;
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color 0.2s ease;
}

.prompt-preview:hover {
    color: var(--accent-primary);
}

.prompt-preview svg {
    flex-shrink: 0;
    margin-top: 0.15rem;
    color: var(--accent-purple);
}

/* User Badge */
.user-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 0.5rem;
    font-size: 0.8rem;
    color: var(--accent-purple);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Date Text */
.date-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Icon Buttons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.btn-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-action-icon:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.btn-action-icon.btn-delete:hover {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Toast notifications for history page */
.history-toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 0.75rem 1.5rem;
    padding-left: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.history-toast.toast-success {
    background: #1a4d3a;
    border-color: var(--accent-success);
    color: var(--accent-success);
}

.history-toast.toast-error {
    background: #4d1a1a;
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.history-toast::before {
    content: '';
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 0.5rem 0 0 0.5rem;
}

.history-toast.toast-success::before {
    background: var(--accent-success);
}

.history-toast.toast-error::before {
    background: var(--accent-danger);
}

/* Responsive adjustments for history table */
@media (max-width: 1200px) {
    .th-prompt { width: 35%; min-width: 200px; }
    .th-user { width: 140px; }
    .th-date { width: 130px; }
}

@media (max-width: 992px) {
    .history-table th,
    .history-table td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .th-id { display: none; }
    .td-id { display: none; }

    .action-buttons {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .th-user { display: none; }
    .td-user { display: none; }

    .th-example { display: none; }
    .td-example { display: none; }

    .th-response { width: 80px; text-align: center; }
    .td-response { text-align: center; }

    .date-text {
        font-size: 0.75rem;
    }
}

.list-group-item {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    background-color: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.list-group-item:first-child {
    border-top: 0;
}

.list-group-item:last-child {
    border-bottom: 0;
}

.list-group-item:hover {
    background-color: var(--bg-hover);
}

.truncate-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    color: var(--accent-primary);
    transition: color 0.2s;
    word-break: break-word;
}

.truncate-text:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* === EMPTY STATES & PLACEHOLDERS === */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    background-color: var(--bg-tertiary);
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    margin: 20px 0;
}

.empty-state-text {
    color: var(--text-secondary);
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
}

.empty-state-icon-large {
    font-size: 4rem;
    opacity: 0.5;
}

.result-placeholder {
    width: 100%;
    min-height: 500px;
    border: 2px dashed var(--border-light);
    border-radius: 8px;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.result-placeholder-content {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
}

.result-placeholder-content i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.result-placeholder-content p {
    font-size: 1.1rem;
    margin: 0;
}

/* Loader inside placeholder */
.placeholder-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.placeholder-loader .spinner-border {
    width: 4rem;
    height: 4rem;
    border-width: 0.4rem;
    border-color: var(--accent-primary);
    border-right-color: transparent;
}

.placeholder-loader p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* === SIMULATION IFRAME === */
.response-iframe,
.simulation-iframe,
.sample-iframe {
    width: 100%;
    min-height: 500px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.simulation-container,
.simulation-container-full {
    position: relative;
    width: 100%;
    transition: all 0.3s ease;
}

.simulation-container-full {
    height: 85vh;
    min-height: 600px;
    background: #000;
}

.simulation-iframe {
    height: 100%;
    border: none;
}

/* Fullscreen styles using browser Fullscreen API */
.simulation-container:fullscreen,
.simulation-container:-webkit-full-screen,
.simulation-container:-moz-full-screen,
.simulation-container:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    background: var(--bg-primary);
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.simulation-container:fullscreen .response-iframe,
.simulation-container:fullscreen .sample-iframe,
.simulation-container:fullscreen .simulation-iframe,
.simulation-container:-webkit-full-screen .response-iframe,
.simulation-container:-webkit-full-screen .sample-iframe,
.simulation-container:-webkit-full-screen .simulation-iframe {
    width: 100%;
    height: 100vh !important;
    min-height: 100vh;
    border: none;
    border-radius: 0;
}

.fullscreen-controls {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 100000;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.simulation-container:hover .fullscreen-controls {
    opacity: 1;
}

body.fullscreen-active .simulation-container:not(.fullscreen) .fullscreen-controls {
    display: none !important;
    pointer-events: none;
}

.btn-fullscreen-toggle {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.btn-fullscreen-toggle:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.exit-fullscreen-btn {
    display: none;
}

.simulation-container:fullscreen .exit-fullscreen-btn,
.simulation-container:-webkit-full-screen .exit-fullscreen-btn {
    display: flex;
}

.simulation-container:fullscreen .enter-fullscreen-btn,
.simulation-container:-webkit-full-screen .enter-fullscreen-btn {
    display: none;
}

/* Hide scrollbar when in fullscreen */
body.fullscreen-active {
    overflow: hidden;
}

.response-container {
    padding: 20px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 50px;
    max-height: 400px;
    overflow-y: auto;
}

.response-container p {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.response-container ul, .response-container ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-primary);
}

.response-container h1, .response-container h2, .response-container h3,
.response-container h4, .response-container h5, .response-container h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.response-container pre {
    background-color: var(--bg-primary);
    padding: 1rem;
    border-radius: 0.375rem;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.response-container code {
    background-color: var(--bg-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: var(--accent-secondary);
}

.response-container blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
}

/* Loading spinner */
#loading {
    padding: 20px;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

#loading .spinner-border {
    color: var(--accent-primary);
    width: 3rem;
    height: 3rem;
}

#loading p {
    color: var(--text-secondary);
}

/* Alerts */
.alert {
    border-radius: 8px;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--accent-danger);
    color: #fca5a5;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-success);
    color: #6ee7b7;
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--accent-warning);
    color: #fcd34d;
}

/* Modal styling */
.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title {
    color: var(--text-primary);
}

.modal-body {
    background-color: var(--bg-card);
}

.modal-footer {
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Secondary button styling */
.btn-secondary {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

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

/* Spinner colors */
.spinner-border {
    color: var(--accent-primary);
}

/* Table styling */
.table {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid var(--border-color) !important;
    padding: 12px 15px;
    font-weight: 600;
}

.table tbody td {
    background-color: var(--bg-card) !important;
    color: var(--text-secondary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 12px 15px;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) td {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

.table tbody tr:hover td {
    background-color: var(--bg-hover) !important;
    color: var(--text-primary) !important;
}

/* Action buttons standardization */
.btn-action {
    width: 90px;
    padding: 6px 0;
    font-weight: 600;
    transition: all 0.2s;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    background-color: var(--accent-primary) !important;
    border: 1px solid var(--accent-primary) !important;
    color: white !important;
}

.btn-edit:hover {
    background-color: var(--accent-primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.btn-delete {
    background-color: transparent !important;
    border: 1px solid var(--accent-danger) !important;
    color: var(--accent-danger) !important;
}

.btn-delete:hover {
    background-color: var(--accent-danger) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Scrollbar styling for webkit browsers */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Placeholder states */
.placeholder-error {
    animation: fadeIn 0.3s ease-out;
}

.placeholder-loader {
    animation: fadeIn 0.3s ease-out;
}

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

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

/* Prompt input enhancements */
.prompt-wrapper {
    position: relative;
    width: 100%;
}

.prompt-wrapper .form-control {
    padding-right: 45px; /* Space for the clear button */
    min-height: 100px;
    resize: vertical;
}

.clear-prompt-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 5;
    opacity: 0;
    visibility: hidden;
}

.prompt-wrapper:hover .clear-prompt-btn,
.prompt-wrapper textarea:focus + .clear-prompt-btn {
    opacity: 1;
    visibility: visible;
}

.clear-prompt-btn:hover {
    background-color: var(--accent-danger);
    border-color: var(--accent-danger);
    color: white;
}

/* Table content truncation with wrapping */
.truncate-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    color: var(--accent-primary);
    transition: color 0.2s;
    word-break: break-word;
}

.truncate-text:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

/* Base styles for buttons */

/* Login Page Styles - using glass-effect and enhanced-card now */

.login-form-container {
    width: 400px !important;
    max-width: calc(100% - 2rem) !important;
    padding: 2rem;
    border-radius: 1rem;
    flex-shrink: 0;
}

.or-separator {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
}

.or-separator::before,
.or-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.or-separator:not(:empty)::before {
    margin-right: .5em;
}

.or-separator:not(:empty)::after {
    margin-left: .5em;
}

.btn-google {
    background-color: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-google:hover {
    background-color: #f8f9fa;
    color: #3c4043;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    border-color: #dadce0;
}

.btn-google img {
    width: 18px;
    height: 18px;
}

/* ============================================
   SHARED UTILITIES FROM LANDING PAGE
   ============================================ */

/* Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass Effect */
.glass-effect {
    background: rgba(42, 47, 69, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
}

/* Card Hover Effect */
.card-hover {
    transition: all 0.3s ease;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.card-hover:hover {
    transform: translateY(-8px);
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.3);
}

/* Gradient Button */
.gradient-button {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    z-index: 1;
}

.gradient-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary-reverse);
    transition: left 0.3s ease;
    z-index: -1;
}

.gradient-button:hover::before {
    left: 0;
}

.gradient-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.4);
    color: white;
    text-decoration: none;
}

/* Icon Backgrounds */
.icon-purple {
    background: rgba(168, 85, 247, 0.2);
    color: var(--accent-purple);
}

.icon-cyan {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.icon-pink {
    background: rgba(236, 72, 153, 0.2);
    color: var(--accent-pink);
}

.icon-green {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}


/* Animations */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    }
    50% {
        box-shadow: 0 0 40px rgba(168, 85, 247, 0.8);
    }
}

.pulse-glow {
    animation: pulse-glow 3s ease-in-out infinite;
}

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

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Enhanced Cards */
.enhanced-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.enhanced-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 42rem;
    margin: 0 auto;
}

/* Responsive utilities */
@media (max-width: 768px) {
    .section-header {
        margin-bottom: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }
}

/* ============================================
   BOOTSTRAP COMPONENTS THEMING
   ============================================ */

/* Modals */
.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.modal-title {
    color: var(--text-primary);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.8);
}

.btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.7;
}

.btn-close:hover {
    opacity: 1;
}

/* Form Check */
.form-check-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.form-check-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
}

.form-check-label {
    color: var(--text-primary);
}

/* Form Text */
.form-text {
    color: var(--text-muted);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.75rem;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert-info {
    background-color: rgba(34, 211, 238, 0.2);
    color: var(--accent-secondary);
    border: 1px solid rgba(34, 211, 238, 0.3);
}

/* Spinner */
.spinner-border {
    border-color: var(--accent-primary);
    border-right-color: transparent;
}

.spinner-border.text-primary {
    border-color: var(--accent-primary);
    border-right-color: transparent;
}

