/* --- Tasarım Temelleri ve Genel Stiller --- */
:root {
    --color-primary: #4F46E5;
    --color-secondary: #0EA5E9;
    --color-accent: #F59E0B;
    --color-bg: #F9FAFB;
    --color-text: #111827;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
}

/* Used for primary action buttons such as Jira Task Oluşturucu and Risk Analizi */
.btn-primary:hover {
    background-color: #4338CA;
}

.text-primary {
    color: var(--color-primary) !important;
}

.bg-primary {
    background-color: var(--color-primary) !important;
}

.hover-bg-primary-dark:hover {
    background-color: #4338CA !important;
}

/* Override Tailwind's default blue palette with project primary color */
.text-blue-600 {
    color: var(--color-primary) !important;
}

.bg-blue-600 {
    background-color: var(--color-primary) !important;
}

.hover\:bg-blue-700:hover {
    background-color: #4338CA !important;
}

.error-message {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.spinner {
    border-top-color: var(--color-primary);
    animation: spin 1s linear infinite;
}

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

/* Yeniden kullanılabilir yükleme katmanı ve spinner */
.loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

/* Ensure Tailwind's `.hidden` can actually hide the overlay */
.loading-overlay.hidden {
    display: none !important;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #e5e7eb;
    border-top-color: var(--color-primary);
    border-radius: 9999px;
    animation: spin 1s linear infinite;
}

/* --- Ana Sayfa ve Bileşen Stilleri --- */
.sidebar-link.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

.dashboard-card { 
    transition: all 0.3s ease-in-out; 
}

.dashboard-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); 
}

.tool-content, .result-card { 
    animation: fadeIn 0.5s ease-in-out; 
}

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

/* --- Görsel Analiz Sonuç Kartları Stilleri --- */
.progress-bar { 
    background-color: #e5e7eb; 
}

.progress-bar-fill {
    background-color: var(--color-primary);
    transition: width 0.5s ease-in-out;
}

/* --- Chatbot Stilleri --- */
.chat-bubble { 
    max-width: 80%; 
}

.chat-bubble.user { 
    background-color: #DBEAFE; 
    align-self: flex-end; 
}

.chat-bubble.bot { 
    background-color: #F3F4F6; 
    align-self: flex-start; 
}

/* --- Chatbot ve Çıktı Alanları için Ortak Stiller --- */
.chat-bubble p, .output-content p { 
    margin-bottom: 0.75rem; 
    line-height: 1.6; color: #374151; 
}

.chat-bubble ul, .output-content ul { 
    list-style-type: disc; 
    padding-left: 1.5rem; 
    margin-bottom: 1rem; 
    color: #374151; 
}

.chat-bubble li, .output-content li { 
    margin-bottom: 0.5rem; 
}
        
/* Chatbot'a Özel Başlık Stili */
.chat-bubble h3 { 
    font-size: 1.125rem; 
    font-weight: 700; 
    margin-top: 1.25rem; 
    margin-bottom: 0.75rem; 
    border-bottom: 1px solid #e5e7eb; 
    padding-bottom: 0.5rem;
}

/* --- Jira ve Risk Analizi Çıktı Stilleri (GÜNCEL) --- */

/* Ana Başlıkların (H2) stilini iyileştiriyoruz */
.output-content h2, .output-content h3, .output-content .risk-h2 {
    margin-top: 2.5rem; /* Üstündeki elementle arasını açıyoruz */
    margin-bottom: 1.5rem; /* Altındaki kartla arasını açıyoruz */
    border-bottom: 2px solid #3B82F6; /* Alt çizgiyi daha belirgin hale getiriyoruz */
    padding-bottom: 0.75rem;
    font-size: 1.25rem; /* Fontu biraz büyütüyoruz */
    font-weight: 700;
}

.output-content h2:first-child, .output-content h3:first-child, .output-content .risk-h2:first-child {
    margin-top: 0; /* İlk başlıkta üst boşluk olmasın */
}

/* Risk Üçlüsü Gruplama ve Ayırıcı Stili */
.risk-triplet + .risk-triplet {
    border-top: 1px solid #e5e7eb; /* Üst kenarlık olarak ayırıcı çizgi */
    margin-top: 1.5rem;           /* Üstteki blokla arasına boşluk koy */
    padding-top: 1.5rem;          /* Çizgi ile metin arasına boşluk koy */
}

/* Bir üçlü içindeki paragrafların arasına standart boşluk koy */
.risk-triplet p {
    margin-bottom: 0.75rem;
}

.risk-triplet p:last-child {
    margin-bottom: 0;
}

/* Fade-in yardımcı sınıfı */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* Jira modal paneli için slide animasyonu */
.jira-modal-panel {
    animation: slideIn 0.3s ease-out;
}

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

/* YENİ: Zıplayan Yükleyici Animasyonu */
.bouncing-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 2.5rem; /* Mesaj balonuyla aynı yükseklikte olması için */
}

.bouncing-loader > div {
    width: 8px;
    height: 8px;
    margin: 3px;
    background-color: #9ca3af; /* Orta ton bir gri */
    border-radius: 50%;
    animation: bouncing 0.6s infinite alternate;
}

/* İkinci ve üçüncü noktaya gecikme vererek dalga efekti yaratıyoruz */
.bouncing-loader > div:nth-child(2) {
    animation-delay: 0.2s;
}

.bouncing-loader > div:nth-child(3) {
    animation-delay: 0.4s;
}

.loading-ellipsis {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 2.5rem;
    color: #9ca3af;
    font-size: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    .bouncing-loader > div {
        animation: none;
    }
}

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

/* --- Hero Alanı İyileştirmeleri --- */
#hero-background {
    background-image: radial-gradient(ellipse at center, hsl(243, 85%, 10%), #0a0a1a);
}

/* --- YENİ: Ana Sayfa İyileştirmeleri --- */
body.dashboard-view {
    background-color: #0a0a1a;
}

.content-section {
    background-color: #FFFFFF;
    color: #111827; /* İçerik alanlarındaki metin rengini siyaha döndürür */
}

/* --- Hero Alanı İyileştirmeleri --- */
#hero {
    background-color: #0a0a1a; /* Fallback color */
    background-image: radial-gradient(ellipse at center, hsl(243, 85%, 15%), #0a0a1a 70%);
}

/* Hero text container'ın mouse etkileşimini neural background'a geçirmesi için */
#hero .relative.z-10 {
    pointer-events: none;
}

/* Hero içindeki link'lerin tekrar etkileşimli olması için */
#hero .relative.z-10 a {
    pointer-events: auto;
}

/* --- YENİ: AI Medya Oynatıcı Stilleri --- */
.player-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #4B5563; /* gray-600 */
    transition: color 0.2s ease;
}
.player-btn:hover {
    color: var(--color-primary);
}
.play-pause-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    background-color: #F3F4F6; /* gray-100 */
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.play-pause-btn:hover {
    background-color: #E5E7EB; /* gray-200 */
}

.playlist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.playlist-item:hover {
    background-color: #F9FAFB; /* gray-50 */
}
.playlist-item.active {
    background-color: #EFF6FF; /* blue-50 */
    color: var(--color-primary);
}
.playlist-item.active .font-semibold {
    color: var(--color-primary);
}

/* --- YENİ: Sesli Giriş Butonu Stilleri --- */
.voice-input-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 40px;
    position: relative;
    overflow: hidden;
}

.voice-input-button:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.voice-input-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.voice-button-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.voice-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.voice-icon {
    width: 20px;
    height: 20px;
    color: #6b7280;
    transition: color 0.2s ease;
}

.voice-input-button:hover .voice-icon {
    color: var(--color-primary);
}

.voice-button-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: inherit;
}

/* Kayıt durumu stilleri */
.voice-input-button.recording {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    animation: recordingButtonPulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.voice-input-button.recording .voice-icon {
    color: #dc2626;
    animation: recordingIconBounce 1s ease-in-out infinite;
}

.voice-input-button.recording .voice-button-text {
    color: #dc2626;
    font-weight: 600;
}

/* Kayıt göstergesi */
.recording-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.voice-input-button.recording .recording-indicator {
    opacity: 1;
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

@keyframes recordingButtonPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.3), 0 0 40px rgba(239, 68, 68, 0.1);
    }
    50% {
        box-shadow: 0 0 25px rgba(239, 68, 68, 0.5), 0 0 50px rgba(239, 68, 68, 0.2);
    }
}

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

/* Ses dalgası animasyonu için ilave container */
.voice-input-button.recording::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: inherit;
    animation: soundWave 1.5s ease-out infinite;
    z-index: -1;
}

@keyframes soundWave {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Devre dışı durum */
.voice-input-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.voice-input-button:disabled:hover {
    border-color: #e5e7eb;
    background-color: #ffffff;
    transform: none;
    box-shadow: none;
}
