/* Premium Dark Mode Glassmorphism Theme for Link Analyst */
:root {
    --bg-color: #0f172a; /* Slate 900 */
    --card-bg: rgba(30, 41, 59, 0.7); /* Slate 800 with opacity */
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc; /* Slate 50 */
    --text-secondary: #94a3b8; /* Slate 400 */
    --accent: #3b82f6; /* Blue 500 */
    --accent-hover: #2563eb; /* Blue 600 */
    --success: #10b981;
    --error: #ef4444;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#link-analyst-app-container {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: #ffffff !important;
    min-height: 500px;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    line-height: 1.6;
}

#link-analyst-app-container * {
    color: inherit;
}

/* Background glow effect */
#link-analyst-app-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.la-content {
    position: relative;
    z-index: 1;
}

/* Typography */
.la-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    background: linear-gradient(to right, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Mode Switcher */
.la-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.la-tab-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.la-tab-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.la-tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
}

/* Panels */
.la-panel {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.la-panel.active {
    display: block;
}

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

/* Inputs and Forms */
.la-input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.la-input {
    flex: 1;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid var(--card-border) !important;
    padding: 1rem 1.5rem !important;
    border-radius: 12px !important;
    color: #f8fafc !important; /* Force white text */
    font-size: 1rem !important;
    transition: all 0.3s ease;
}

.la-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.la-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.la-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.la-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Glass Cards */
.la-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease;
}

.la-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Video Results */
.la-video-result {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
}

.la-video-frame {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.la-video-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.la-video-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.la-transcript-match {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success);
    padding: 1rem;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

.la-transcript-match span {
    font-weight: bold;
    color: var(--success);
}

/* File Upload */
.la-upload-zone {
    border: 2px dashed var(--card-border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(15, 23, 42, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.la-upload-zone:hover, .la-upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.la-upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.la-upload-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.la-file-input {
    display: none;
}

/* Audio Results Grid */
.la-audio-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}
/* Modal Styles */
#la-translation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.la-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.la-modal-content {
    position: relative;
    z-index: 101;
    width: 90%;
    max-width: 1000px;
    max-height: 90%;
    overflow-y: auto;
    background: rgba(15, 23, 42, 0.95) !important;
}

.la-modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.la-modal-close:hover {
    color: #ffffff;
}
.la-result-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
}

.la-result-box h4 {
    margin-top: 0;
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.la-text-content {
    color: var(--text-primary);
    white-space: pre-wrap;
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Loaders */
.la-loader {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.la-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .la-video-result {
        grid-template-columns: 1fr;
    }
    .la-audio-results {
        grid-template-columns: 1fr;
    }
}
