/* ============================================================================
   Landing Page Specific Styles
   ============================================================================ */

/* ============================================================================
   Container
   ============================================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* ============================================================================
   Hero Section
   ============================================================================ */
.hero {
    text-align: center;
    margin-bottom: clamp(2rem, 8vw, 4rem);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.greeting-message {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 500;
    min-height: 1.8em;
}

.greeting-cursor {
    display: inline-block;
    color: var(--accent-primary);
    font-weight: 300;
    margin-left: 1px;
    animation: greetingBlink 0.7s step-end infinite;
}

@keyframes greetingBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.user-name {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: slideUp 0.8s ease-out 0.2s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gradient-text {

    background: var(--gradient);
    text-shadow:
        0 0 10px cyan 0 0 20px cyan 0 0 40px cyan 0 0 80px cyan,
    ;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ============================================================================
   Research Form
   ============================================================================ */
.research-form {
    margin-bottom: 0.5rem;
    animation: slideUp 0.8s ease-out 0.6s both;
}

.input-wrapper {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    max-width: 850px;
    margin: 0 auto;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg), 0 0 0 4px rgba(22, 163, 74, 0.15);
    transform: translateY(-2px);
}

.query-input {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 1.125rem;
    color: var(--text-primary);
    font-family: inherit;
    resize: none;
    overflow-y: auto;
    scrollbar-width: none;
    --max-query-height: 200px;
    min-height: clamp(56px, 7vh, 76px);
    max-height: var(--max-query-height);
    height: auto;
    padding: clamp(0.5rem, 1.2vw, 0.75rem);
    line-height: 1.6;
}

.query-input::-webkit-scrollbar {
    display: none;
}

.query-input:focus {
    outline: none;
}

.query-input:read-only {
    opacity: 0.7;
    cursor: not-allowed;
}

.query-input::placeholder {
    color: var(--text-tertiary);
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
}

.action-buttons, .right-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-tertiary);
    border: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.char-count {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    color: white;
    border: none;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* ============================================================================
   Messages
   ============================================================================ */
.messages-container {
    margin-top: 1.5rem;
}

.message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.message-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

/* ============================================================================
   Features Section
   ============================================================================ */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1rem, 4vw, 2rem);
    margin-bottom: clamp(2rem, 8vw, 4rem);
}

.feature-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    text-align: center;
    transition: all 0.3s ease;
    animation: fadeIn 0.8s ease-out;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-primary);
}

.feature-icon {
    width: 4rem;
    height: 4rem;
    background: var(--gradient);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ============================================================================
   Footer
   ============================================================================ */
.footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer-text {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }



    .logo {
        height: 40px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-subtitle {
        font-size: 0.75rem;
    }

    .desktop-only {
        display: none !important;
    }

    .hamburger-menu {
        display: block;
    }

    .input-wrapper {
        padding: clamp(0.5rem, 2vw, 0.625rem);
        min-height: clamp(90px, 10vh, 118px);
        border-radius: 1.25rem;
    }

    .query-input {
        min-height: clamp(52px, 6.5vh, 68px);
    }

    .input-footer {
        right: clamp(0.5rem, 2vw, 0.625rem);
        bottom: clamp(0.35rem, 1.5vw, 0.5rem);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .input-wrapper {
        min-height: clamp(84px, 10vh, 108px);
    }
    .query-input {
        min-height: clamp(48px, 6vh, 62px);
        font-size: 1rem;
    }

    .feature-card {
        padding: 1.5rem 1.25rem;
    }
}

/* ============================================================================
   Footer Links & Document Page Layout Styles
   ============================================================================ */
.footer-links {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* Styling for document page layouts */
.doc-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    animation: fadeIn 0.6s ease-out;
}

.doc-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: clamp(2rem, 5vw, 3rem);
    box-shadow: var(--shadow-lg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .doc-card {
    background: var(--bg-secondary);
}

.doc-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.doc-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.doc-meta {
    font-size: 0.875rem;
    color: var(--text-tertiary);
}

.doc-section {
    margin-bottom: 2rem;
}

.doc-section h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    border-left: 4px solid var(--accent-primary);
    padding-left: 0.75rem;
    transition: color 0.3s ease;
}

.doc-section p, .doc-section ul {
    color: var(--text-tertiary);
    line-height: 1.7;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.doc-section ul {
    padding-left: 1.5rem;
}

.doc-section li {
    margin-bottom: 0.5rem;
    color: var(--text-tertiary);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.back-btn:hover {
    transform: translateX(-4px);
    color: var(--accent-hover);
}

.back-btn svg {
    transition: transform 0.2s ease;
}

.back-btn:hover svg {
    transform: translateX(-2px);
}

/* ============================================================================
   Voice Input — Modal, Sound-Wave Bars, Spinner & Toast
   ============================================================================ */

/* ── Overlay ── */
.voice-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.voice-modal-overlay.visible {
    opacity: 1;
}

/* ── Card ── */
.voice-modal-card {
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    padding: 2rem 2.5rem 2rem;
    min-width: 300px;
    max-width: 380px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.voice-modal-overlay.visible .voice-modal-card {
    transform: translateY(0) scale(1);
}

[data-theme="dark"] .voice-modal-card {
    background: #111111;
    border-color: #2a2a2a;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

/* ── Header ── */
.voice-modal-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.voice-modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    letter-spacing: 0.02em;
}

[data-theme="dark"] .voice-modal-title {
    color: #f1f5f9;
}

/* ── Sound-Wave Bars ── */
.voice-wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 60px;
}

.voice-wave-bar {
    display: inline-block;
    width: 5px;
    border-radius: 3px;
    background: var(--accent-primary, #16a34a);
    animation: voiceWave 1s ease-in-out infinite;
}

/* Stagger each bar for a fluid wave effect */
.voice-wave-bar:nth-child(1) { animation-delay: 0s;     animation-duration: 0.9s;  }
.voice-wave-bar:nth-child(2) { animation-delay: 0.15s;  animation-duration: 1.05s; }
.voice-wave-bar:nth-child(3) { animation-delay: 0.3s;   animation-duration: 0.85s; }
.voice-wave-bar:nth-child(4) { animation-delay: 0.45s;  animation-duration: 1.1s;  }
.voice-wave-bar:nth-child(5) { animation-delay: 0.6s;   animation-duration: 0.95s; }

@keyframes voiceWave {
    0%, 100% {
        height: 8px;
        opacity: 0.5;
    }
    50% {
        height: 52px;
        opacity: 1;
    }
}

[data-theme="dark"] .voice-wave-bar {
    background: #22c55e;
}

/* ── Processing Spinner ── */
.voice-spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}

.voice-spinner-ring {
    width: 44px;
    height: 44px;
    border: 3.5px solid var(--border-color, #e2e8f0);
    border-top-color: var(--accent-primary, #16a34a);
    border-radius: 50%;
    animation: voiceSpin 0.75s linear infinite;
}

@keyframes voiceSpin {
    to { transform: rotate(360deg); }
}

[data-theme="dark"] .voice-spinner-ring {
    border-color: #2a2a2a;
    border-top-color: #22c55e;
}

/* ── Status Text ── */
.voice-status-text {
    font-size: 0.9rem;
    color: var(--text-secondary, #475569);
    margin: 0;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.01em;
}

[data-theme="dark"] .voice-status-text {
    color: #94a3b8;
}

/* ── Timer ── */
.voice-timer {
    font-size: 1.6rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-family: 'Courier New', Courier, monospace;
    color: var(--text-primary, #0f172a);
    margin: 0;
    letter-spacing: 0.04em;
}

[data-theme="dark"] .voice-timer {
    color: #f1f5f9;
}

/* ── Action Buttons ── */
.voice-modal-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
}

.voice-cancel-btn,
.voice-stop-btn {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.voice-cancel-btn {
    background: var(--bg-tertiary, #f1f5f9);
    color: var(--text-secondary, #475569);
    border: 1px solid var(--border-color, #e2e8f0);
}

.voice-cancel-btn:hover:not(:disabled) {
    background: var(--bg-secondary, #f8fafc);
    transform: translateY(-1px);
}

.voice-cancel-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.voice-stop-btn {
    background: var(--accent-primary, #16a34a);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.35);
}

.voice-stop-btn:hover {
    background: var(--accent-secondary, #15803d);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.45);
}

.voice-stop-btn:active {
    transform: translateY(0);
}

[data-theme="dark"] .voice-cancel-btn {
    background: #1a1a1a;
    border-color: #2a2a2a;
    color: #94a3b8;
}

[data-theme="dark"] .voice-cancel-btn:hover:not(:disabled) {
    background: #222222;
}

[data-theme="dark"] .voice-stop-btn {
    background: #22c55e;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.35);
}

[data-theme="dark"] .voice-stop-btn:hover {
    background: #16a34a;
    box-shadow: 0 4px 16px rgba(34, 197, 94, 0.45);
}

/* ── Toast Notifications ── */
.voice-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    max-width: 420px;
    width: calc(100% - 2rem);
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    z-index: 9999;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.voice-toast--visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.voice-toast--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #15803d;
}

.voice-toast--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.voice-toast--info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

[data-theme="dark"] .voice-toast--success {
    background: #052e16;
    border-color: #15803d;
    color: #4ade80;
}

[data-theme="dark"] .voice-toast--error {
    background: #2d0000;
    border-color: #7f1d1d;
    color: #f87171;
}

[data-theme="dark"] .voice-toast--info {
    background: #0f1e3d;
    border-color: #1e40af;
    color: #60a5fa;
}

.voice-toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.voice-toast-msg {
    flex: 1;
}

/* ── Active mic button state (while recording) ── */
#voiceBtn.voice-recording {
    color: var(--accent-primary, #16a34a);
    animation: voiceMicPulse 1.5s ease-in-out infinite;
}

@keyframes voiceMicPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

/* ==========================================================================
   File Upload Chips
   ========================================================================== */
.file-chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    padding-bottom: 0;
    width: 100%;
}

.file-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary, #f1f5f9);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 1rem;
    font-size: 0.85rem;
    color: var(--text-primary, #0f172a);
    max-width: 200px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

[data-theme="dark"] .file-chip {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.file-chip--error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.file-chip-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #64748b);
}

.file-chip-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.file-chip-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-chip-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-top-color: var(--accent-primary, #16a34a);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.file-chip-close {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--text-secondary, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.file-chip-close:hover {
    background: rgba(0,0,0,0.1);
    color: #ef4444;
}

[data-theme="dark"] .file-chip-close:hover {
    background: rgba(255,255,255,0.1);
}

.input-wrapper {
    flex-direction: column;
}

/* Height-based responsiveness for Query Forms */
@media (max-height: 700px) {
    .query-input {
        --max-query-height: 140px;
        min-height: clamp(48px, 6vh, 60px) !important;
        font-size: 1.05rem;
        padding: 0.5rem 0.75rem !important;
    }
    .input-wrapper {
        min-height: auto !important; /* Override standard min-height clamp */
        border-radius: 1.25rem;
    }
    .hero {
        margin-bottom: clamp(1rem, 4vh, 2rem) !important;
    }
    .hero-title {
        font-size: clamp(1.75rem, 4.5vh, 2.5rem) !important;
        margin-bottom: 0.5rem;
    }
    .greeting-message {
        margin-bottom: 0.5rem;
    }
}

@media (max-height: 500px) {
    .query-input {
        --max-query-height: 90px;
        min-height: clamp(38px, 5.5vh, 48px) !important;
        font-size: 0.95rem;
        padding: 0.4rem 0.6rem !important;
    }
    .input-wrapper {
        min-height: auto !important;
        border-radius: 1rem;
    }
    .input-footer {
        padding: 0.25rem 0.5rem !important;
    }
    .action-btn {
        width: 30px !important;
        height: 30px !important;
    }
    .hero {
        margin-bottom: clamp(0.75rem, 3vh, 1.5rem) !important;
    }
    .hero-title {
        font-size: clamp(1.5rem, 4vh, 2rem) !important;
        margin-bottom: 0.25rem;
    }
    .greeting-message {
        margin-bottom: 0.25rem;
        font-size: clamp(0.95rem, 2vh, 1.1rem) !important;
    }
}
