/* antrikshGPT - Stunning Space-Themed Webapp Styles */

:root {
    /* Space color palette */
    --space-black: #0a0a0a;
    --space-dark: #1a1a2e;
    --space-blue: #16213e;
    --space-purple: #2d1b69;
    --space-cyan: #00d9ff;
    --space-pink: #ff006e;
    --space-gold: #ffbe0b;
    --space-white: #ffffff;
    --space-gray: #8b949e;
    --space-green: #39d353;
    
    /* Gradients */
    --nebula-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --cosmic-gradient: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff);
    --aurora-gradient: linear-gradient(90deg, #00d9ff, #39d353, #ffbe0b);
    
    /* Shadows and glows */
    --glow-cyan: 0 0 20px rgba(0, 217, 255, 0.3);
    --glow-pink: 0 0 20px rgba(255, 0, 110, 0.3);
    --glow-gold: 0 0 20px rgba(255, 190, 11, 0.3);
    
    /* Fonts */
    --font-primary: 'Orbitron', monospace;
    --font-secondary: 'Exo 2', sans-serif;
}

/* Skip link */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #000;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 10000;
}

.skip-link:focus { left: 12px; top: 12px; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background: var(--space-black);
    color: var(--space-white);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Animated Space Background */
.space-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
}

.stars, .stars2, .stars3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #eee, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: twinkle 3s infinite;
}

.stars2 {
    background-size: 400px 200px;
    animation: twinkle 2s infinite reverse;
}

.stars3 {
    background-size: 600px 300px;
    animation: twinkle 4s infinite;
}

.nebula {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at 30% 50%, 
        rgba(138, 43, 226, 0.1) 0%, 
        transparent 50%
    ), radial-gradient(
        circle at 70% 30%, 
        rgba(255, 0, 110, 0.1) 0%, 
        transparent 50%
    ), radial-gradient(
        circle at 20% 80%, 
        rgba(0, 217, 255, 0.1) 0%, 
        transparent 50%
    );
    animation: float 20s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: rotate(0deg) translateX(0px); }
    33% { transform: rotate(120deg) translateX(20px); }
    66% { transform: rotate(240deg) translateX(-20px); }
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(0.5px);
}

/* Header */
.header {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2rem;
    animation: pulse 2s infinite;
}

.logo-text {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 900;
    color: var(--space-white);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.4);
    position: relative;
    overflow: hidden;
}

.logo-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--space-cyan), transparent);
    transform: translateY(-50%);
    animation: comet 3s ease-in-out infinite;
    box-shadow: 0 0 10px var(--space-cyan);
}

.logo-highlight {
    color: var(--space-cyan);
    text-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
    animation: highlight-pulse 2s ease-in-out infinite;
}



.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--space-green);
    box-shadow: var(--glow-cyan);
    animation: pulse 2s infinite;
}

.status-text {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--space-cyan);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes comet {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

@keyframes highlight-pulse {
    0%, 100% {
        text-shadow: 0 0 15px rgba(0, 217, 255, 0.6);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 25px rgba(0, 217, 255, 0.8);
        transform: scale(1.02);
    }
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Sidebar Widgets */
.sidebar, .sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--aurora-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 217, 255, 0.2);
    border-color: var(--space-cyan);
}

.widget:hover::before {
    opacity: 1;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.widget-header h3 {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 0 5px rgba(0, 217, 255, 0.2);
}

.refresh-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--space-green);
    animation: pulse 1.5s infinite;
}

/* ISS Widget */
.iss-location {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.iss-map {
    position: relative;
    height: 120px;
    background: linear-gradient(180deg, #001122 0%, #003366 100%);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

.earth-icon {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
}

.iss-icon {
    position: absolute;
    font-size: 1.2rem;
    transition: all 0.5s ease;
    animation: orbit 10s infinite linear;
}

@keyframes orbit {
    0% { transform: translate(20px, 20px); }
    25% { transform: translate(80px, 30px); }
    50% { transform: translate(70px, 70px); }
    75% { transform: translate(30px, 80px); }
    100% { transform: translate(20px, 20px); }
}

/* APOD Widget */
.apod-content img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.apod-title {
    font-weight: 600;
    color: var(--space-cyan);
    margin-bottom: 0.5rem;
}

.apod-explanation {
    font-size: 0.8rem;
    color: var(--space-gray);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Space News Widget */
#space-news-content .news-item {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: rgba(0, 217, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--space-cyan);
}

#space-news-content .news-item a {
    color: var(--space-cyan);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

#space-news-content .news-item a:hover {
    text-decoration: underline;
}

/* Mars Weather Widget */
#mars-weather-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* People Widget */
.people-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.person-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--space-cyan);
}

.person-avatar {
    font-size: 1.5rem;
}

.person-info h4 {
    font-size: 0.9rem;
    color: var(--space-white);
    margin-bottom: 0.2rem;
}

.person-craft {
    font-size: 0.8rem;
    color: var(--space-gray);
}

/* Planetary Widget */
.planet-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
}

/* People Widget */
.people-count {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    color: var(--space-cyan);
    text-align: center;
    margin-bottom: 0.5rem;
    text-shadow: var(--glow-cyan);
}

.people-names {
    font-size: 0.9rem;
    color: var(--space-gray);
    text-align: center;
    line-height: 1.4;
}

/* Weather Widget */
.weather-content .news-item {
    margin-bottom: 0.8rem;
    padding: 0.8rem;
    background: rgba(0, 217, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--space-cyan);
}

.weather-content .news-item a {
    color: var(--space-cyan);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.weather-content .news-item a:hover {
    text-decoration: underline;
}

/* Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 20, 0.7);
    border-radius: 12px;
    margin: 0 1rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid var(--space-border-light);
}

.chat-container {
    flex: 1;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative; /* for floating buttons */
}

.chat-header {
    padding: 1.5rem;
    background: rgba(0, 217, 255, 0.1);
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    text-align: center;
    position: relative;
}

.chat-header h2 {
    font-family: var(--font-primary);
    color: #e6e9f5;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.2);
}

.chat-header p {
    color: var(--space-gray);
    font-size: 0.9rem;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-height: calc(100vh - 320px);
}

/* Sticky composer */
.chat-input-container { position: sticky; bottom: 0; z-index: 5; background: linear-gradient(to top, rgba(10,10,20,0.95), rgba(10,10,20,0.6)); box-shadow: 0 -10px 20px rgba(0,0,0,.25); }
.chat-input-wrapper { background: rgba(26,26,46,0.6); border: 1px solid rgba(0, 217, 255, 0.2); border-radius: 12px; padding: 0.5rem; }

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    max-width: 85%;
    animation: messageSlide 0.4s var(--ease-smooth);
}

.user-message {
    justify-content: flex-end;
    align-self: flex-end;
    flex-direction: row-reverse;
    animation: slideInRight 0.4s var(--ease-smooth);
}

.assistant-message {
    justify-content: flex-start;
    align-self: flex-start;
    animation: slideInLeft 0.4s var(--ease-smooth);
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: var(--space-blue);
}

.assistant-message .message-avatar {
    background: var(--space-purple);
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    line-height: 1.6;
    color: var(--space-light-gray);
}

.user-message .message-content {
    background: rgba(45, 75, 120, 0.5);
    border-top-left-radius: 0;
}

.assistant-message .message-content {
    background: rgba(26, 26, 46, 0.8);
    border-top-right-radius: 0;
}

.message-timestamp {
    font-size: 0.75rem;
    color: var(--space-gray);
    margin-top: 0.25rem;
    padding-left: 0.25rem;
}

.user-message .message-content-wrapper {
    align-items: flex-end;
}

.user-message .message-timestamp {
    padding-left: 0;
    padding-right: 0.25rem;
}

.welcome-message {
    background: none;
    max-width: 100%;
}

.welcome-message .message-content {
    background: rgba(10, 10, 20, 0.8);
    border: 1px solid var(--space-border-light);
}

.welcome-message ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.welcome-message li {
    margin: 0.5rem 0;
    color: var(--space-gray);
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Chat Input */
.chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--space-border-light);
    background: rgba(10, 10, 20, 0.8);
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chat-input-wrapper:focus-within {
    border-color: var(--space-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--space-white);
    padding: 0.75rem 1rem;
    font-family: 'Exo 2', sans-serif;
    font-size: 1rem;
    resize: none;
    max-height: 150px;
    overflow-y: auto;
}

#chat-input:focus {
    border-color: var(--space-cyan);
    box-shadow: var(--glow-cyan);
    background: rgba(26, 26, 46, 0.9);
}

#chat-input::placeholder {
    color: var(--space-gray);
}

.send-button {
    background: var(--space-cyan);
    border: none;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    margin: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-button:hover {
    background: var(--space-green);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.send-button:active {
    transform: translateY(0);
}

.send-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.send-button:hover .send-icon {
    transform: rotate(-45deg);
}

.chat-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}

.char-counter {
    font-size: 0.8rem;
    color: var(--space-gray);
}

.input-suggestions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Suggestion Section */
.suggestion-section {
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.suggestion-header {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.2);
}

/* Capabilities Section */
.capabilities-section {
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.capability-card {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: left;
    transition: all 0.3s ease;
}

.capability-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 217, 255, 0.2);
}

.capability-icon {
    font-size: 2.5rem;
    margin-bottom: 0;
}

.capability-card h4 {
    font-family: var(--font-primary);
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 0 0 6px rgba(0, 217, 255, 0.15);
}

.capability-card p {
    color: var(--space-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* MCP Tools Section */
.mcp-tools-section {
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.mcp-tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.mcp-tool-card {
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(255, 190, 11, 0.2);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 120px;
}

.mcp-tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 190, 11, 0.2);
    border-color: rgba(255, 190, 11, 0.4);
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.tool-info h4 {
    font-family: var(--font-primary);
    color: var(--space-gold);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-shadow: 0 0 6px rgba(255, 190, 11, 0.3);
}

.tool-info p {
    color: var(--space-gray);
    font-size: 0.75rem;
    line-height: 1.4;
    margin: 0;
}

.suggestion-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--space-border);
    color: var(--space-light-gray);
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.suggestion-chip:hover {
    background: rgba(0, 217, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: var(--glow-cyan);
    color: var(--space-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 255, 255, 0.2);
}

/* Launches and News Widgets */
.launch-item, .news-item {
    padding: 1rem;
    background: rgba(0, 217, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--space-cyan);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.launch-item:hover, .news-item:hover {
    background: rgba(0, 217, 255, 0.1);
    transform: translateX(4px);
}

.launch-title, .news-title {
    font-weight: 600;
    color: var(--space-cyan);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.3;
}

.launch-date, .news-date {
    color: var(--space-gray);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.launch-status {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-success {
    background: rgba(57, 211, 83, 0.2);
    color: var(--space-green);
}

.status-upcoming {
    background: rgba(255, 190, 11, 0.2);
    color: var(--space-gold);
}

.status-failure {
    background: rgba(255, 0, 110, 0.2);
    color: var(--space-pink);
}

/* Stats Widget */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 217, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.2);
}

.stat-value {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--space-cyan);
    text-shadow: var(--glow-cyan);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--space-gray);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Space Facts Widget */
.fact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: rgba(138, 43, 226, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--space-purple);
    margin-bottom: 0.8rem;
}

.fact-value {
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--space-white);
}

.fact-label {
    font-size: 0.8rem;
    color: var(--space-gray);
}

/* Launch countdown styling */
.launch-countdown {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--space-gold);
    font-weight: 600;
    margin: 0.5rem 0;
}

/* Loading States */
.loading {
    text-align: center;
    color: var(--space-gray);
    font-style: italic;
    animation: pulse 2s infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 217, 255, 0.3);
    border-top: 4px solid var(--space-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
    box-shadow: var(--glow-cyan);
}

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

.loading-content h2 {
    font-family: var(--font-primary);
    color: var(--space-cyan);
    margin-bottom: 1rem;
    text-shadow: var(--glow-cyan);
}

.loading-content p {
    color: var(--space-gray);
}

/* Footer */
.footer {
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 217, 255, 0.2);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-content p {
    color: var(--space-gray);
    margin-bottom: 0.5rem;
}

.sanskrit-quote {
    font-family: var(--font-primary);
    font-size: 1rem;
    color: #e6e9f5;
    text-shadow: 0 0 6px rgba(0, 217, 255, 0.15);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--space-cyan);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: var(--space-white);
    text-shadow: 0 0 8px var(--space-cyan);
}

.footer-separator {
    color: var(--space-gray);
    font-size: 0.8rem;
    margin: 0 0.5rem;
}

.powered-by {
    font-size: 0.8rem;
    color: var(--space-cyan);
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.5);
}

::-webkit-scrollbar-thumb {
    background: var(--space-cyan);
    border-radius: 4px;
}

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

/* Enhanced Responsive Design */
/* Large tablets and small desktops */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 240px 1fr 240px;
        gap: 1.2rem;
        padding: 1.2rem;
    }
    
    .widget {
        padding: 1.2rem;
    }
}

/* Tablets */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .sidebar, .sidebar-right {
        order: 2;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
        overflow: visible;
    }
    
    .sidebar .widget, .sidebar-right .widget {
        min-width: auto;
        width: 100%;
    }
    
    .chat-section {
        order: 1;
        height: 85vh;
        min-height: 560px;
        margin: 0;
    }

    /* Let messages expand inside the taller chat section */
    .chat-messages { max-height: none; }
    
    .capabilities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .mcp-tools-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }
    
    .suggestion-chip {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* Mobile phones */
@media (max-width: 640px) {
    .header {
        padding: 0.8rem 0;
    }
    
    .header-content {
        padding: 0 1rem;
        gap: 0.5rem;
    }
    
    .logo {
        gap: 0.8rem;
    }
    
    .logo-text {
        font-size: 1.4rem;
    }
    
    .logo-icon {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 0.8rem;
        gap: 1.2rem;
        min-height: 100svh; /* small viewport height to avoid mobile URL bar issues */
    }
    
    .sidebar, .sidebar-right {
        grid-template-columns: 1fr;
    }
    
    .widget {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .chat-container {
        border-radius: 12px;
    }
    
    .chat-header {
        padding: 0.8rem 1rem;
    }
    
    .chat-header h2 {
        font-size: 1.2rem;
    }

    /* Hide tagline to reduce header clutter on small screens */
    .chat-header p { display: none; }
    
    .chat-messages {
        padding: 0.9rem;
        gap: 0.8rem;
        max-height: none; /* allow flex to allocate remaining height */
        min-height: 0; /* fix flex overflow on some mobile browsers */
    }
    
    .message { max-width: 98%; }
    
    .message-avatar { width: 28px; height: 28px; font-size: 1rem; }
    
    .message-content { padding: 0.55rem 0.7rem; font-size: 0.92rem; }
    
    .chat-input-container { padding: 0.8rem; }
    
    .chat-input-wrapper {
        background: rgba(26, 26, 46, 0.6);
        border: 1px solid rgba(0, 217, 255, 0.25);
        border-radius: 12px;
        padding: 0.4rem;
    }

    .chat-input-wrapper:focus-within { box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.25); }
    
    #chat-input { padding: 0.75rem; font-size: 0.96rem; border-radius: 8px; }

    /* Reduce aggressive glow on focus */
    #chat-input:focus { box-shadow: none; }
    
    .send-button { width: 34px; height: 34px; margin: 0; border-radius: 8px; }
    
    .send-icon {
        font-size: 1.2rem;
    }
    
    .capabilities-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .mcp-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .mcp-tool-card {
        padding: 0.8rem;
        min-height: 100px;
    }
    
    .tool-icon {
        font-size: 1.5rem;
        margin-bottom: 0.6rem;
    }
    
    .tool-info h4 {
        font-size: 0.8rem;
    }
    
    .tool-info p {
        font-size: 0.7rem;
    }
    
    .capability-card {
        padding: 1.2rem;
        gap: 1rem;
    }
    
    .capability-icon {
        font-size: 2rem;
    }
    
    .suggestion-section {
        padding: 1.5rem 1rem;
    }
    
    .input-suggestions {
        justify-content: flex-start;
        gap: 0.4rem;
    }
    
    .suggestion-chip {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
        border-radius: 20px;
    }
    
    .footer {
        padding: 1rem 0;
    }
    
    .footer-content {
        padding: 0 1rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-separator {
        display: none;
    }
}

/* Small mobile phones */
@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem;
    }
    
    .chat-section {
        height: 88vh;
        min-height: 560px;
    }

    .chat-messages { max-height: none; }
    
    .widget-header h3 {
        font-size: 0.9rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .launch-title, .news-title {
        font-size: 0.85rem;
    }
}

/* Custom Animations */
@keyframes cosmic-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(0, 217, 255, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 217, 255, 0.8), 0 0 30px rgba(255, 0, 110, 0.3);
    }
}

.cosmic-glow {
    animation: cosmic-pulse 3s infinite;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    color: var(--space-gray);
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--space-cyan);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

pre {
    position: relative;
    background: #0d1117;
    border: 1px solid var(--space-border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

pre code {
    color: #c9d1d9;
    background: none;
    padding: 0;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--space-border);
    color: var(--space-light-gray);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background: var(--space-cyan);
    color: var(--space-dark-blue);
}

.widget-content {
    padding: 0.5rem 1rem 1rem;
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.chat-header-title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.clear-chat-button {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    transform: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 217, 255, 0.25);
    color: var(--space-gray);
    font-size: 1.35rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.clear-chat-button:hover {
    color: var(--space-white);
    background: rgba(0, 217, 255, 0.18);
    border-color: rgba(0, 217, 255, 0.5);
    opacity: 1;
}

/* Scroll to bottom button */
.scroll-bottom-btn {
    position: absolute;
    bottom: 88px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 217, 255, 0.3);
    background: rgba(10, 10, 20, 0.8);
    color: var(--space-cyan);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.scroll-bottom-btn.show {
    display: flex;
}

.scroll-bottom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 217, 255, 0.2);
}



/* NEO Widget */
#neo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Tool Call Widget */
.tool-call-widget {
    background: rgba(26, 26, 46, 0.9);
    border: 1px solid rgba(255, 190, 11, 0.3);
    transition: all 0.4s ease;
}

.tool-call-widget.active {
    border-color: var(--space-gold);
    box-shadow: 0 0 20px rgba(255, 190, 11, 0.3);
    animation: tool-call-pulse 2s infinite;
}

.tool-call-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--space-gray);
    transition: all 0.3s ease;
}

.tool-call-status.idle {
    background: var(--space-gray);
}

.tool-call-status.active {
    background: var(--space-gold);
    box-shadow: 0 0 10px rgba(255, 190, 11, 0.6);
    animation: pulse-gold 1s infinite;
}

.tool-call-idle {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--space-gray);
}

.idle-indicator {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
    animation: idle-float 3s ease-in-out infinite;
}

.idle-text {
    font-size: 0.9rem;
    font-style: italic;
}

.tool-call-active {
    padding: 1rem 0;
    min-height: auto;
}

.tool-call-item {
    display: grid;
    grid-template-columns: 24px 1fr 20px;
    align-items: start;
    column-gap: 0.8rem;
    row-gap: 0.25rem;
    padding: 0.9rem 0.9rem;
    background: rgba(255, 190, 11, 0.08);
    border-radius: 10px;
    border-left: 3px solid var(--space-gold);
    margin-bottom: 0.9rem;
    animation: tool-call-item-enter 0.4s ease;
}

.tool-call-icon {
    grid-column: 1;
    font-size: 1.2rem;
    animation: spin-slow 2s linear infinite;
    align-self: start;
}

.tool-call-info {
    grid-column: 2;
    min-width: 0; /* allow wrapping */
}

.tool-call-name {
    font-weight: 700;
    color: var(--space-gold);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tool-call-description {
    font-size: 0.82rem;
    color: var(--space-gray);
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.tool-call-progress {
    grid-column: 3;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 190, 11, 0.3);
    border-top: 2px solid var(--space-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    align-self: start;
}

/* Tool Call Animations */
@keyframes tool-call-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(255, 190, 11, 0.3);
        border-color: rgba(255, 190, 11, 0.3);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 190, 11, 0.6);
        border-color: var(--space-gold);
    }
}

@keyframes pulse-gold {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 190, 11, 0.6);
    }
    50% { 
        transform: scale(1.2);
        box-shadow: 0 0 15px rgba(255, 190, 11, 0.8);
    }
}

@keyframes idle-float {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
        opacity: 0.6;
    }
    50% { 
        transform: translateY(-5px) rotate(5deg);
        opacity: 0.8;
    }
}

@keyframes tool-call-item-enter {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animation for removing tool call item */
@keyframes tool-call-item-exit {
    to {
        opacity: 0;
        transform: translateX(20px) scale(0.9);
        height: 0;
        padding-top: 0;
        padding-bottom: 0;
        margin-bottom: 0;
        border-width: 0;
    }
}

/* Accessibility and Performance Improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .stars, .stars2, .stars3, .nebula {
        animation: none;
    }
}

/* Focus states for accessibility */
.widget:focus-within,
.suggestion-chip:focus,
.send-button:focus,
#chat-input:focus {
    outline: 2px solid var(--space-cyan);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .widget {
        border-color: var(--space-cyan);
        border-width: 2px;
    }
    
    .message-content {
        border-width: 2px;
    }
    
    .suggestion-chip {
        border-width: 2px;
    }
}

/* Enhanced widget hover effects */
.widget {
    position: relative;
    transition: all 0.4s var(--ease-smooth);
}

.widget::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--glass-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 16px;
    pointer-events: none;
}

.widget:hover::after {
    opacity: 1;
}

/* Enhanced loading states with better performance */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, 
        rgba(26, 26, 46, 0.4) 0%, 
        rgba(0, 217, 255, 0.1) 50%, 
        rgba(26, 26, 46, 0.4) 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: 8px;
    height: 20px;
    margin-bottom: 8px;
}

/* Better scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(26, 26, 46, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--space-cyan), rgba(0, 217, 255, 0.7));
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--space-cyan);
}

/* Tool call completed state */
.tool-call-item.completed {
    background: rgba(57, 211, 83, 0.1);
    border-left-color: var(--space-green);
    animation: tool-call-complete 0.5s ease forwards;
    box-shadow: 0 0 15px rgba(57, 211, 83, 0.4);
}

.tool-call-item.completed .tool-call-name {
    color: var(--space-green);
}

.tool-call-item.completed .tool-call-icon {
    animation: none;
}

@keyframes tool-call-complete {
    0% {
        background: rgba(255, 190, 11, 0.1);
        border-left-color: var(--space-gold);
    }
    100% {
        background: rgba(57, 211, 83, 0.2);
        border-left-color: var(--space-green);
        transform: scale(1.02);
    }
}

.tool-call-completed-icon {
    grid-column: 3;
    font-size: 1.2rem;
    color: var(--space-green);
    animation: pop-in 0.45s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    align-self: start;
}

@keyframes pop-in {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(45deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}