/* Ultra-modern styles for Crowe Logic™ AI System */

/* Crowe Logic advanced color palette */
:root {
    /* Core brand colors */
    --crowe-neon-blue: #00CCFF;
    --crowe-electric-cyan: #00FFFF;
    --crowe-deep-blue: #004455;
    --crowe-vivid-magenta: #FF00FF;
    
    /* UI foundation */
    --crowe-obsidian: #080C10; /* Primary background */
    --crowe-carbon: #121820; /* Secondary background */
    --crowe-midnight: #1A2028; /* Card/container background */
    --crowe-adamantium: #2A3038; /* Elevated elements */
    
    /* Text hierarchy */
    --crowe-pure-white: #FFFFFF; /* Primary text */
    --crowe-alpine: #E0E6ED; /* Secondary text */
    --crowe-platinum: #A0ABB8; /* Tertiary/muted text */
    
    /* Gradients & Effects */
    --crowe-glow: rgba(0, 204, 255, 0.8);
    --crowe-neural-glow: rgba(0, 204, 255, 0.4);
    --crowe-neural-accent: rgba(255, 0, 255, 0.15);
    --crowe-holographic: linear-gradient(135deg, #00CCFF 0%, #00FFFF 50%, #FF00FF 100%);
    --crowe-neural-gradient: linear-gradient(180deg, var(--crowe-obsidian) 0%, var(--crowe-carbon) 100%);
    
    /* System status */
    --crowe-success: #00FFAA;
    --crowe-warning: #FFCC00;
    --crowe-error: #FF3366;
    --crowe-info: #33BBFF;
}

/* Base styling with advanced neural aesthetic */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--crowe-neural-gradient);
    color: var(--crowe-pure-white);
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    overflow-x: hidden;
    letter-spacing: 0.01em;
}

/* Advanced neural network visualization in background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(0, 204, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.03) 0%, transparent 40%);
    opacity: 0.8;
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 40L140 140M360 40L260 140M40 360L140 260M360 360L260 260M200 200L140 140M200 200L260 140M200 200L140 260M200 200L260 260' stroke='%2300CCFF' stroke-width='0.6' stroke-opacity='0.06'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    z-index: -1;
    pointer-events: none;
    opacity: 0.15;
}

/* Make main content take up available space with padding */
main {
    flex: 1;
    padding: 1rem 0;
    position: relative;
    z-index: 1;
}

/* Typography enhancement */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
    background: var(--crowe-holographic);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

h2 {
    font-size: 2rem;
    color: var(--crowe-pure-white);
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
    color: var(--crowe-alpine);
}

p {
    line-height: 1.6;
    color: var(--crowe-alpine);
}

small, .text-muted {
    color: var(--crowe-platinum) !important;
}

/* Ultra-modern card design with depth & lighting effects */
.card {
    background: var(--crowe-midnight);
    border: 1px solid rgba(0, 204, 255, 0.08);
    border-radius: 12px;
    box-shadow: 
        0 4px 20px -2px rgba(0, 0, 0, 0.5),
        0 0 15px -3px rgba(0, 204, 255, 0.15);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 204, 255, 0.3), transparent);
    z-index: 2;
}

.card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 
        0 15px 35px -5px rgba(0, 0, 0, 0.5),
        0 0 25px -5px rgba(0, 204, 255, 0.25);
    border-color: rgba(0, 204, 255, 0.2);
}

.card-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(0, 204, 255, 0.08);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Advanced code display with neural network aesthetic */
.code-block {
    border-radius: 12px;
    margin-bottom: 1.5rem;
    position: relative;
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid rgba(0, 204, 255, 0.15);
    background: rgba(8, 12, 16, 0.85);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(0, 204, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 204, 255, 0.2), transparent);
    z-index: 2;
}

.code-block pre {
    margin-bottom: 0;
    padding: 1.5rem;
    border-radius: 0 0 12px 12px;
    background-color: transparent;
    color: var(--crowe-alpine);
    font-family: 'JetBrains Mono', 'Fira Code', 'Roboto Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 204, 255, 0.1);
    background: linear-gradient(90deg, 
        rgba(0, 0, 0, 0.3), 
        rgba(0, 204, 255, 0.05), 
        rgba(0, 0, 0, 0.3));
    border-radius: 12px 12px 0 0;
}

.code-title {
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--crowe-neon-blue);
    display: flex;
    align-items: center;
}

.code-title::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: var(--crowe-neon-blue);
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 8px var(--crowe-neon-blue);
}

/* Ultra-modern Pipeline components badges */
.component-badge {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, rgba(0, 204, 255, 0.8), rgba(0, 204, 255, 0.4));
    color: var(--crowe-obsidian);
    border: none;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(0, 204, 255, 0.2);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.component-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 204, 255, 0.3);
}

.component-badge i {
    margin-right: 5px;
    font-size: 0.9em;
}

/* Ultra-modern form controls with advanced styling */
.form-control {
    background: rgba(8, 12, 16, 0.6);
    border: 1px solid rgba(0, 204, 255, 0.15);
    color: var(--crowe-pure-white);
    border-radius: 10px;
    padding: 0.8rem 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.01em;
}

.form-control:focus {
    box-shadow: 
        0 0 0 1px rgba(0, 204, 255, 0.3),
        0 0 15px rgba(0, 204, 255, 0.2);
    border-color: var(--crowe-neon-blue);
    background: rgba(8, 12, 16, 0.8);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--crowe-alpine);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.form-label .neural-icon {
    margin-right: 0.5rem;
    color: var(--crowe-neon-blue);
}

/* Next-generation button styling */
.btn {
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: all 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn i {
    margin-right: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--crowe-neon-blue), var(--crowe-electric-cyan));
    color: var(--crowe-obsidian);
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 204, 255, 0.3);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.btn-primary:hover, .btn-primary:focus {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 15px rgba(0, 204, 255, 0.4),
        0 0 0 1px rgba(0, 255, 255, 0.3);
    background: linear-gradient(135deg, var(--crowe-electric-cyan), var(--crowe-neon-blue));
    color: var(--crowe-obsidian);
}

.btn-outline-secondary {
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(160, 171, 184, 0.5);
    color: var(--crowe-alpine);
}

.btn-outline-secondary:hover {
    background: rgba(0, 204, 255, 0.08);
    box-shadow: 
        inset 0 0 0 1px var(--crowe-neon-blue),
        0 4px 10px rgba(0, 204, 255, 0.15);
    color: var(--crowe-neon-blue);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.btn-outline-info {
    border: 1px solid rgba(0, 204, 255, 0.3);
    color: var(--crowe-neon-blue);
    background: rgba(0, 204, 255, 0.05);
}

.btn-outline-info:hover {
    background: rgba(0, 204, 255, 0.1);
    color: var(--crowe-electric-cyan);
    border-color: var(--crowe-electric-cyan);
}

/* Footer with brand styling */
.footer {
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--crowe-metallic-silver);
    padding: 1.5rem 0;
    border-top: 1px solid rgba(0, 204, 255, 0.1);
}

/* Advanced prompt input form with neural highlighting */
.prompt-form {
    max-width: 850px;
    margin: 0 auto;
    position: relative;
}

.prompt-textarea {
    min-height: 140px;
    resize: vertical;
    background: rgba(8, 12, 16, 0.7);
    border: 1px solid rgba(0, 204, 255, 0.2);
    color: var(--crowe-pure-white);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 12px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    padding: 1rem;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.prompt-textarea:focus {
    background: rgba(8, 12, 16, 0.8);
    border-color: var(--crowe-neon-blue);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 204, 255, 0.2),
        0 0 20px rgba(0, 204, 255, 0.2);
    outline: none;
}

.prompt-form::after {
    content: '';
    position: absolute;
    bottom: 40px;
    right: 10px;
    width: 80px;
    height: 80px;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' opacity='0.1'%3E%3Ccircle cx='50' cy='50' r='5' fill='%2300CCFF' filter='blur(2px)'/%3E%3Cpath d='M30 30L50 50M70 30L50 50M30 70L50 50M70 70L50 50' stroke='%2300CCFF' stroke-width='0.5'/%3E%3Ccircle cx='30' cy='30' r='3' fill='none' stroke='%2300CCFF' stroke-width='0.5'/%3E%3Ccircle cx='70' cy='30' r='3' fill='none' stroke='%2300CCFF' stroke-width='0.5'/%3E%3Ccircle cx='30' cy='70' r='3' fill='none' stroke='%2300CCFF' stroke-width='0.5'/%3E%3Ccircle cx='70' cy='70' r='3' fill='none' stroke='%2300CCFF' stroke-width='0.5'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.15;
    z-index: 1;
}

/* Enhanced example prompts */
.example-prompts {
    margin: 1.5rem 0;
}

.example-prompt-btn {
    transition: all 0.25s ease;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    background: rgba(0, 204, 255, 0.05);
    border: 1px solid rgba(0, 204, 255, 0.2);
    color: var(--crowe-alpine);
}

.example-prompt-btn:hover {
    background: rgba(0, 204, 255, 0.1);
    color: var(--crowe-neon-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 204, 255, 0.15);
}

/* Next-gen feature highlights with neural glow */
.highlight-section {
    position: relative;
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    background: rgba(0, 204, 255, 0.03);
    border: 1px solid rgba(0, 204, 255, 0.1);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 0 15px rgba(0, 204, 255, 0.05);
    overflow: hidden;
}

.highlight-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--crowe-neon-blue), transparent);
    opacity: 0.6;
}

.highlight-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg' opacity='0.07'%3E%3Cpath d='M10 10L30 30M70 10L50 30M10 90L30 70M90 90L70 70M50 50L30 30M50 50L70 30M50 50L30 70M50 50L70 70' stroke='%2300CCFF' stroke-width='1'/%3E%3Ccircle cx='50' cy='50' r='5' fill='%2300CCFF' filter='blur(3px)'/%3E%3Ccircle cx='30' cy='30' r='3' fill='none' stroke='%2300CCFF'/%3E%3Ccircle cx='70' cy='30' r='3' fill='none' stroke='%2300CCFF'/%3E%3Ccircle cx='30' cy='70' r='3' fill='none' stroke='%2300CCFF'/%3E%3Ccircle cx='70' cy='70' r='3' fill='none' stroke='%2300CCFF'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Neural-inspired loading animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 12, 16, 0.95);
    background-image: 
        radial-gradient(circle at 30% 20%, rgba(0, 204, 255, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 0, 255, 0.05) 0%, transparent 50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}

.spinner-container {
    text-align: center;
    color: var(--crowe-pure-white);
    position: relative;
    z-index: 1;
}

.spinner-container::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    right: -40px;
    bottom: -40px;
    background: radial-gradient(circle, rgba(0, 204, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    animation: neural-pulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes neural-pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

.spinner-border {
    width: 3.5rem;
    height: 3.5rem;
    border-width: 0.25rem;
    color: var(--crowe-neon-blue) !important;
    box-shadow: 0 0 25px var(--crowe-neural-glow);
    animation: spinner-grow 1.2s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

.spinner-text {
    margin-top: 1.5rem;
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--crowe-pure-white);
    letter-spacing: 0.05em;
    text-shadow: 0 0 15px rgba(0, 204, 255, 0.8);
    max-width: 320px;
    opacity: 0.9;
}

/* Neural nodes animation for loading screen */
.neural-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.2;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3ClinearGradient id='neural-gradient' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%2300CCFF' stop-opacity='0.4'/%3E%3Cstop offset='100%25' stop-color='%23FF00FF' stop-opacity='0.1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 0L100 100M100 0L0 100' stroke='url(%23neural-gradient)' stroke-width='0.5'/%3E%3C/svg%3E");
}

/* Ultramodern navbar styling */
.navbar {
    background: rgba(8, 12, 16, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 204, 255, 0.15);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.2),
        0 2px 0 rgba(0, 204, 255, 0.05);
    padding: 0.75rem 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    color: var(--crowe-pure-white) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    position: relative;
}

.navbar-brand img {
    height: 32px;
    margin-right: 12px;
    filter: drop-shadow(0 0 8px rgba(0, 204, 255, 0.5));
}

.navbar-brand span small {
    opacity: 0.7;
    font-weight: 300;
    letter-spacing: 0;
}

.nav-link {
    color: var(--crowe-alpine) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-link:hover {
    color: var(--crowe-pure-white) !important;
    background: rgba(0, 204, 255, 0.08);
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--crowe-neon-blue) !important;
    background: rgba(0, 204, 255, 0.1);
    box-shadow: inset 0 0 0 1px rgba(0, 204, 255, 0.2);
    text-shadow: 0 0 10px rgba(0, 204, 255, 0.5);
}

/* Ultra-modern footer */
.footer {
    background: rgba(8, 12, 16, 0.9);
    color: var(--crowe-alpine);
    padding: 2rem 0;
    border-top: 1px solid rgba(0, 204, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 204, 255, 0.3), transparent);
    opacity: 0.8;
}

.footer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 1200 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 50L1200 50' stroke='%2300CCFF' stroke-width='0.2' stroke-opacity='0.1'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
}

/* Custom scrollbar for neural interface */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 204, 255, 0.2);
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 204, 255, 0.4);
}

/* Modal modern styling */
.modal-content {
    background: var(--crowe-midnight);
    border: 1px solid rgba(0, 204, 255, 0.1);
    border-radius: 12px;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(0, 204, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 204, 255, 0.1);
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 204, 255, 0.1);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    color: var(--crowe-pure-white);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.btn-close-white {
    filter: drop-shadow(0 0 5px rgba(0, 204, 255, 0.3));
}

/* Neural icon common styles for reuse */
.neural-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 204, 255, 0.1);
    color: var(--crowe-neon-blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    box-shadow: 0 0 10px rgba(0, 204, 255, 0.15);
}