/* --- 1. Global Styles & Theme --- */
:root {
    --background-dark: #0a0a1a;
    --background-light: #1a1a2e;
    --primary-accent: #00f2ea;
    --secondary-accent: #8e44ad;
    --text-primary: #f0f0f5;
    --text-secondary: #a0a0b0;
    --card-bg: rgba(26, 26, 46, 0.5); /* Semi-transparent card background */
    --glass-border: rgba(255, 255, 255, 0.1);
    --neon-glow: 0 0 20px rgba(0, 242, 234, 0.3);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-dark);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(140, 68, 173, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 242, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, var(--background-light) 0%, var(--background-dark) 25%);
    color: var(--text-primary);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Floating particles background */
.particle {
    position: fixed;
    pointer-events: none;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.1;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.3;
    }
}

/* --- 2. Main Layout --- */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    text-align: center;
    animation: containerFadeIn 1s ease-out;
}

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

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

/* Typing animation effect */
.typing-text {
    overflow: hidden;
    border-right: 3px solid var(--primary-accent);
    white-space: nowrap;
    animation: typing 3s steps(25) 0.5s forwards, blink 0.8s infinite;
    width: 0;
    margin: 0 auto;
}

.typing-text-sub {
    opacity: 0;
    animation: fadeInDelay 0.8s ease-out 3.5s forwards;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: var(--primary-accent); }
    51%, 100% { border-color: transparent; }
}

@keyframes fadeInDelay {
    to { opacity: 1; }
}

/* --- Example Queries --- */
.example-queries {
    text-align: center;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInDelay 0.8s ease-out 2.5s forwards;
}

.example-queries span {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-right: 15px;
}

.example-btn {
    background: rgba(26, 26, 46, 0.5);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    margin: 0 5px 5px 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

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

/* --- 3. Search Box --- */
.search-box {
    display: flex;
    position: relative;
    margin-bottom: 40px;
    opacity: 0;
    animation: slideInUp 1s ease-out 4s forwards;
}

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

#query-input {
    flex-grow: 1;
    padding: 15px 20px;
    border-radius: 50px;
    border: 1px solid var(--background-light);
    background-color: var(--background-light);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    backdrop-filter: blur(10px);
}

#query-input::placeholder {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

#query-input:focus::placeholder {
    transform: translateY(-2px);
    color: rgba(160, 160, 176, 0.5);
}

#query-input:hover {
    border-color: rgba(0, 242, 234, 0.5);
    box-shadow: 0 0 15px rgba(0, 242, 234, 0.1);
    transform: translateY(-1px);
}

#query-input:focus {
    border-color: var(--primary-accent);
    box-shadow: var(--neon-glow);
    transform: translateY(-2px);
    background-color: rgba(26, 26, 46, 0.8);
}

#query-input.error {
    border-color: #ff5555;
    box-shadow: 0 0 15px rgba(255, 85, 85, 0.3);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

#search-button {
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    width: 45px;
    border: none;
    border-radius: 50%;
    background-image: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

#search-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.6s ease;
    transform: translate(-50%, -50%);
}

#search-button:hover::before {
    width: 100px;
    height: 100px;
}

#search-button:hover {
    transform: scale(1.1);
    box-shadow: var(--neon-glow);
}

#search-button:active {
    transform: scale(0.95);
}

#search-button.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* --- 4. Loading Animation --- */
.loader {
    text-align: center;
    margin: 40px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loader.show {
    opacity: 1;
}

.loader-container {
    display: inline-block;
    padding: 30px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 242, 234, 0.1);
    border-top: 4px solid var(--primary-accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

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

.loader-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--primary-accent);
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.3s; }
.dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes dotPulse {
    0%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
    animation: textFade 2s ease-in-out infinite;
}

@keyframes textFade {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- 5. Result Cards (Enhanced Glassmorphism) --- */
#results-container {
    text-align: left;
}

.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: cardFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.result-card:hover::before {
    left: 100%;
}

.result-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(0, 242, 234, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 242, 234, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

@keyframes cardFadeIn {
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

/* Stagger animation for multiple cards */
.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }
.result-card:nth-child(5) { animation-delay: 0.5s; }

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.card-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 500;
    background: linear-gradient(45deg, var(--text-primary), var(--primary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.3s ease;
}

.result-card:hover .card-header h3 {
    transform: translateX(5px);
}

.card-header span {
    margin-left: auto;
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 242, 234, 0.3);
    transition: all 0.3s ease;
}

.result-card:hover .card-header span {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 242, 234, 0.4);
}

.card-section {
    margin-bottom: 15px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.card-section strong {
    color: var(--text-primary);
}

.result-card:hover .card-section {
    color: var(--text-primary);
}

/* Stage indicator and badge styles */
.stage-indicator {
    margin: 15px 0;
    display: flex;
    justify-content: flex-start;
}

.stage-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-idea {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
}

.stage-preseed {
    background: linear-gradient(45deg, #48dbfb, #0abde3);
    color: white;
}

.stage-seed {
    background: linear-gradient(45deg, #1dd1a1, #10ac84);
    color: white;
}

.stage-seriesa {
    background: linear-gradient(45deg, #feca57, #ff9ff3);
    color: white;
}

.stage-growth {
    background: linear-gradient(45deg, #5f27cd, #341f97);
    color: white;
}

/* Role badge styling */
.role-badge {
    margin-left: auto;
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 242, 234, 0.3);
    transition: all 0.3s ease;
}

/* Card actions styling */
.card-actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-link {
    display: inline-block;
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    border: 1px solid var(--primary-accent);
    border-radius: 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.action-link:hover {
    background: var(--primary-accent);
    color: var(--background-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 242, 234, 0.3);
}

.show-more-btn {
    background: transparent;
    border: 2px solid var(--primary-accent);
    color: var(--primary-accent);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.show-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    transition: left 0.4s ease;
    z-index: -1;
}

.show-more-btn:hover::before {
    left: 0;
}

.show-more-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 242, 234, 0.3);
}

.more-details {
    max-height: 0;
    overflow: hidden;
    margin-top: 20px;
    padding-top: 0;
    border-top: 1px solid rgba(0, 242, 234, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.more-details.show {
    max-height: 800px;
    padding-top: 20px;
    opacity: 1;
}

/* --- 6. Custom Scrollbar & Responsive Design --- */
::-webkit-scrollbar { 
    width: 8px; 
}
::-webkit-scrollbar-track { 
    background: var(--background-dark); 
}
::-webkit-scrollbar-thumb { 
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    border-radius: 4px; 
}
::-webkit-scrollbar-thumb:hover { 
    background: var(--primary-accent); 
}

/* --- 7. Responsive Design --- */
@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 15px;
    }

    .header h1 {
        font-size: 2rem;
    }

    .header p {
        font-size: 1rem;
    }

    .search-box {
        margin-bottom: 30px;
    }

    #query-input {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    #search-button {
        width: 40px;
        right: 4px;
        top: 4px;
        bottom: 4px;
    }

    .result-card {
        padding: 20px;
        margin-bottom: 15px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-header span,
    .role-badge {
        margin-left: 0;
        align-self: flex-end;
    }

    .stage-indicator {
        margin: 10px 0;
    }

    .card-actions {
        flex-direction: column;
        gap: 8px;
    }

    .action-link {
        text-align: center;
    }

    .typing-text {
        animation: typing 2s steps(20) 0.5s forwards, blink 0.8s infinite;
    }

    /* Reduce particles on mobile */
    .particle:nth-child(n+8) {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .result-card {
        padding: 15px;
    }

    .loader-container {
        padding: 20px;
    }

    .spinner {
        width: 50px;
        height: 50px;
    }
}

/* --- 8. Additional Animations --- */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.shimmer-effect {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(0, 242, 234, 0.1) 50%,
        transparent 100%
    );
    background-size: 200px 100%;
    animation: shimmer 2s infinite;
}

/* --- 8. Error Messages --- */
.error-message, .no-results {
    text-align: center;
    padding: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    margin: 20px 0;
    animation: cardFadeIn 0.5s ease-out;
}

.error-message h3, .no-results h3 {
    color: var(--primary-accent);
    margin-bottom: 15px;
}

.error-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.retry-btn {
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 242, 234, 0.3);
}

.troubleshoot {
    max-width: 400px;
    text-align: left;
}

.troubleshoot summary {
    color: var(--primary-accent);
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 10px;
}

.troubleshoot-content {
    background: rgba(26, 26, 46, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.troubleshoot-content ol {
    margin: 0;
    padding-left: 20px;
}

.troubleshoot-content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.troubleshoot-content code {
    background: rgba(0, 242, 234, 0.1);
    color: var(--primary-accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* --- 9. Focus and Accessibility --- */
*:focus {
    outline: 2px solid var(--primary-accent);
    outline-offset: 2px;
}

.result-card:focus-within {
    border-color: var(--primary-accent);
    box-shadow: var(--neon-glow);
}

/* --- 10. Print Styles --- */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .particle, .loader, #search-button {
        display: none;
    }
    
    .result-card {
        break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 20px;
    }
}

.highlight {
    background-color: #00f2ea;
    color: #0a0a1a;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 500;
}
/* Add this to your style.css */
.example-queries {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.example-queries span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.example-btn {
    background: var(--background-light);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

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

#query-input.error {
    border-color: #e74c3c;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Particle styling */
.particle {
    position: absolute;
    background: var(--primary-accent);
    border-radius: 50%;
    opacity: 0;
    animation: float 5s infinite ease-in-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-80px) scale(0.8);
        opacity: 0.2;
    }
}