/* Modern UI CSS - Temiz ve Düzenli Son Versiyon */
@import 'https://cdn.tailwindcss.com';

/* Temel Değişkenler */
:root {
    --bg-light: #f9fafb;
    --bg-dark: #111827;
    --text-light: #111827;
    --text-dark: #f9fafb;
    --border-light: #e5e7eb;
    --border-dark: #374151;
    --card-light: #ffffff;
    --card-dark: #1f2937;
}

/* Koyu Tema Desteği */
:root {
    color-scheme: light dark;
}

.dark {
    color-scheme: dark;
}

/* Temel Sayfa Stilleri */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-light);
}

.dark body {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem;
}

/* Başlık ve Açıklama Kartı */
.content-card {
    background-color: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .content-card {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.dark .page-title {
    color: var(--text-dark);
}

.description {
    color: #4b5563;
    line-height: 1.5;
}

.dark .description {
    color: #9ca3af;
}

.accent-text {
    font-weight: 500;
}

/* Görünüm Değiştirme Butonu */
.view-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.view-toggle-button {
    background-color: var(--card-light);
    color: #4b5563;
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-toggle-button:hover {
    background-color: #f3f4f6;
}

.dark .view-toggle-button {
    background-color: var(--card-dark);
    color: #9ca3af;
    border-color: var(--border-dark);
}

.dark .view-toggle-button:hover {
    background-color: #1a2234;
}

/* Tablo Kapsayıcı */
.table-container {
    background-color: var(--card-light);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .table-container {
    background-color: var(--card-dark);
    border-color: var(--border-dark);
}

/* Tablo Stilleri */
.table-scroll {
    overflow-x: auto;
}

.harf-table {
    width: 100%;
    border-collapse: collapse;
}

.harf-table th {
    padding: 0.75rem;
    font-weight: 600;
    text-align: center;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.dark .harf-table th {
    background-color: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

.harf-table td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
}

.dark .harf-table td {
    border-color: #374151;
    color: #f9fafb;
}

/* Tablo satır efektleri */
.table-row {
    background-color: white;
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background-color: #f3f4f6;
}

.dark .table-row {
    background-color: #0f172a;
}

.dark .table-row:hover {
    background-color: #1e293b;
}

/* Hücre stilleri */
.cell-sure, .cell-ayet {
    font-family: ui-monospace, monospace;
    font-weight: 500;
    color: #111827;
    text-align: center;
}

.dark .cell-sure, .dark .cell-ayet {
    color: #f9fafb;
}

.cell-metin {
    text-align: right;
}

.cell-harf {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    color: #111827;
    text-align: center;
}

.dark .cell-harf {
    color: #f9fafb;
}

.cell-toplam {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    color: #111827;
    text-align: center;
    background-color: #f3f4f6;
}

.dark .cell-toplam {
    color: #f9fafb;
    background-color: #1f2937;
}

/* Tablo alt satırı */
.table-footer {
    background-color: #f3f4f6;
}

.dark .table-footer {
    background-color: #1f2937;
}

.totals-label {
    text-align: right;
    font-weight: 600;
    color: #111827;
}

.dark .totals-label {
    color: #f9fafb;
}

.total-cell {
    font-family: ui-monospace, monospace;
    font-weight: 600;
    color: #111827;
    text-align: center;
}

.dark .total-cell {
    color: #f9fafb;
}

.grand-total {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    color: #111827;
    text-align: center;
}

.dark .grand-total {
    color: #f9fafb;
}

/* Kart Görünümü */
.verse-card {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    background-color: white;
    transition: background-color 0.2s ease;
}

.verse-card:hover {
    background-color: #f3f4f6;
}

.dark .verse-card {
    border-color: var(--border-dark);
    background-color: #0f172a;
}

.dark .verse-card:hover {
    background-color: #1e293b;
}

.verse-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.verse-info {
    display: flex;
    gap: 1rem;
}

.verse-number {
    display: flex;
    align-items: center;
}

.info-label {
    font-size: 0.70rem;
    color: #6b7280;
    margin-right: 0.25rem;
}

.dark .info-label {
    color: #9ca3af;
}

.info-value {
    font-family: ui-monospace, monospace;
    color: #111827;
    font-weight: 600;
}

.dark .info-value {
    color: #f9fafb;
}

.letter-counts {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.letter-count {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(0,0,0,0.1);
}

.dark .letter-count {
    border-color: rgba(255,255,255,0.1);
}

.letter-label {
    font-size: 0.875rem;
    color: #111827;
    margin-right: 0.25rem;
    font-weight: 500;
}

.dark .letter-label {
    color: #f9fafb;
}

.letter-value {
    font-family: ui-monospace, monospace;
    color: #111827;
    font-weight: 600;
}

.dark .letter-value {
    color: #f9fafb;
}

.verse-text {
    text-align: right;
    margin-bottom: 0.5rem;
}

.verse-total {
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
}

.dark .verse-total {
    color: #9ca3af;
}

.total-value {
    font-family: ui-monospace, monospace;
    color: #111827;
    font-weight: 600;
}

.dark .total-value {
    color: #f9fafb;
}

/* Özet Kart Stilleri */
.summary-card {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border-radius: 0.5rem;
    background-color: white;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dark .summary-card {
    background-color: #0f172a;
    border-color: var(--border-dark);
}

.summary-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #111827;
}

.dark .summary-title {
    color: #f9fafb;
}

.summary-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    min-width: 5rem;
    border: 1px solid rgba(0,0,0,0.1);
}

.dark .summary-item {
    border-color: rgba(255,255,255,0.1);
}

.summary-label {
    font-size: 0.875rem;
    color: #111827;
    margin-right: 0.5rem;
    font-weight: 500;
}

.dark .summary-label {
    color: #f9fafb;
}

.summary-value {
    font-family: ui-monospace, monospace;
    font-weight: 600;
    color: #111827;
}

.dark .summary-value {
    color: #f9fafb;
}

.summary-total {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.dark .summary-total {
    background-color: #1f2937;
}

.summary-total-label {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-right: 0.75rem;
}

.dark .summary-total-label {
    color: #f9fafb;
}

.summary-total-value {
    font-family: ui-monospace, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-right: 0.5rem;
}

.dark .summary-total-value {
    color: #f9fafb;
}

.summary-multiplier {
    font-family: ui-monospace, monospace;
    color: #6b7280;
    font-weight: 500;
}

.dark .summary-multiplier {
    color: #9ca3af;
}

/* Tema Değiştirme Butonu */
.theme-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem;
    border-radius: 9999px;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 100;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.dark .theme-toggle {
    background-color: #1f2937;
}

.moon-icon {
    display: none;
    height: 1.25rem;
    width: 1.25rem;
    color: #6b7280;
}

.sun-icon {
    display: block;
    height: 1.25rem;
    width: 1.25rem;
    color: #6b7280;
}

.dark .moon-icon {
    display: block;
    color: #9ca3af;
}

.dark .sun-icon {
    display: none;
}

/* Yardımcı Sınıflar */
.hidden {
    display: none;
}

/* Responsive Tasarım */
@media (min-width: 1024px) {
    .view-toggle-container {
        display: flex;
        margin-bottom: 1.5rem;
    }

    .view-toggle-button {
        padding: 0.5rem 1.25rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .verse-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .letter-counts {
        justify-content: flex-end;
    }

    .summary-content {
        flex-direction: column;
    }

    .summary-item {
        width: 100%;
        justify-content: space-between;
    }
}

/* Seçili Harfler ve Renkler */
.arabic-text {
    text-align: right;
}

.arabic-text span[class^="harf_"] {
    opacity: 0.7 !important;
}

/* 1. Renk - Kırmızı */
.arabic-text span[style*="background-color:#E63946"] {
    background-color: rgba(230, 57, 70, 0.7) !important;
    color: black !important;
}

.dark .arabic-text span[style*="background-color:#E63946"] {
    color: white !important;
}

/* 2. Renk - Mavi */
.arabic-text span[style*="background-color:#1D3557"] {
    background-color: rgba(41, 128, 185, 0.7) !important;
    color: black !important;
}

.dark .arabic-text span[style*="background-color:#1D3557"] {
    color: white !important;
}

/* 3. Renk - Sarı */
.arabic-text span[style*="background-color:#FFD166"] {
    background-color: rgba(244, 208, 63, 0.7) !important;
    color: black !important;
}

.dark .arabic-text span[style*="background-color:#FFD166"] {
    color: white !important;
}

/* 4. Renk - Yeşil */
.arabic-text span[style*="background-color:#2A9D8F"] {
    background-color: rgba(39, 174, 96, 0.7) !important;
    color: black !important;
}

.dark .arabic-text span[style*="background-color:#2A9D8F"] {
    color: white !important;
}

/* 5. Renk - Mor */
.arabic-text span[style*="background-color:#9B5DE5"] {
    background-color: rgba(155, 93, 229, 0.7) !important;
    color: black !important;
}

.dark .arabic-text span[style*="background-color:#9B5DE5"] {
    color: white !important;
}

/* Sayı sütunları ve hücreleri */
/* 1. Renk - Kırmızı sütun */
th[style*="background-color:#E6394650"], 
td[style*="background-color:#E6394650"] {
    background-color: rgba(230, 57, 70, 0.4) !important;
}

.dark th[style*="background-color:#E6394650"], 
.dark td[style*="background-color:#E6394650"] {
    background-color: rgba(230, 57, 70, 0.3) !important;
    color: white !important;
}

/* 2. Renk - Mavi sütun */
th[style*="background-color:#1D355750"], 
td[style*="background-color:#1D355750"] {
    background-color: rgba(41, 128, 185, 0.4) !important;
}

.dark th[style*="background-color:#1D355750"], 
.dark td[style*="background-color:#1D355750"] {
    background-color: rgba(41, 128, 185, 0.3) !important;
    color: white !important;
}

/* 3. Renk - Sarı sütun */
th[style*="background-color:#FFD16650"], 
td[style*="background-color:#FFD16650"] {
    background-color: rgba(244, 208, 63, 0.4) !important;
}

.dark th[style*="background-color:#FFD16650"], 
.dark td[style*="background-color:#FFD16650"] {
    background-color: rgba(244, 208, 63, 0.3) !important;
    color: white !important;
}

/* 4. Renk - Yeşil sütun */
th[style*="background-color:#2A9D8F50"], 
td[style*="background-color:#2A9D8F50"] {
    background-color: rgba(39, 174, 96, 0.4) !important;
}

.dark th[style*="background-color:#2A9D8F50"], 
.dark td[style*="background-color:#2A9D8F50"] {
    background-color: rgba(39, 174, 96, 0.3) !important;
    color: white !important;
}

/* 5. Renk - Mor sütun */
th[style*="background-color:#9B5DE550"], 
td[style*="background-color:#9B5DE550"] {
    background-color: rgba(155, 93, 229, 0.4) !important;
}

.dark th[style*="background-color:#9B5DE550"], 
.dark td[style*="background-color:#9B5DE550"] {
    background-color: rgba(155, 93, 229, 0.3) !important;
    color: white !important;
}

/* Kart görünümü için renk düzeltmeleri */
.letter-count[style*="background-color:#E6394650"] {
    background-color: rgba(230, 57, 70, 0.3) !important;
}

.letter-count[style*="background-color:#1D355750"] {
    background-color: rgba(41, 128, 185, 0.3) !important;
}

.letter-count[style*="background-color:#FFD16650"] {
    background-color: rgba(244, 208, 63, 0.3) !important;
}

.letter-count[style*="background-color:#2A9D8F50"] {
    background-color: rgba(39, 174, 96, 0.3) !important;
}

.letter-count[style*="background-color:#9B5DE550"] {
    background-color: rgba(155, 93, 229, 0.3) !important;
}

/* Özet kartlarında renk düzeltmeleri */
.summary-item[style*="background-color:#E6394630"] {
    background-color: rgba(230, 57, 70, 0.3) !important;
}

.summary-item[style*="background-color:#1D355730"] {
    background-color: rgba(41, 128, 185, 0.3) !important;
}

.summary-item[style*="background-color:#FFD16630"] {
    background-color: rgba(244, 208, 63, 0.3) !important;
}

.summary-item[style*="background-color:#2A9D8F30"] {
    background-color: rgba(39, 174, 96, 0.3) !important;
}

.summary-item[style*="background-color:#9B5DE530"] {
    background-color: rgba(155, 93, 229, 0.3) !important;
}

/* Açık temada kart metin renkleri */
.letter-count .letter-label,
.letter-count .letter-value {
    color: black !important;
}

/* Koyu temada kart metin renkleri */
.dark .letter-count .letter-label,
.dark .letter-count .letter-value {
    color: white !important;
}
/* Uzun metin satır atlama ve sayfa uyumu için çözümler */

/* Tablo hücrelerindeki Arapça metinler için satır atlama */
.cell-metin .arabic-text {
    white-space: normal !important;
    word-wrap: break-word !important;
    max-width: 300px; /* Maksimum genişlik, sayfaya göre ayarlanabilir */
    text-align: right;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.6;
}

/* Mobil cihazlarda daha dar genişlik */
@media (max-width: 768px) {
    .cell-metin .arabic-text {
        max-width: 200px;
    }
}

/* Kart görünümündeki uzun metinler için satır atlama */
.verse-text.arabic-text {
    white-space: normal !important;
    word-wrap: break-word !important;
    text-align: right;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.6;
}

/* Genel tablo genişliği kontrolü */
.table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

/* Sayfa genişliğine göre uyum sağlayan tablo */
.harf-table {
    width: 100%;
    table-layout: auto; /* İçeriğe göre sütun genişliklerini ayarlar */
}

/* Arapça metin sütununun genişliği */
.col-metin {
    min-width: 100px;
    max-width: 350px; /* Maksimum genişlik, sayfaya göre ayarlanabilir */
}

/* Sayı sütunları için minimum ve maksimum genişlikler */
.col-sure, .col-ayet, .col-harf, .col-toplam {
    min-width: 60px;
    max-width: 75px;
}
/* Sütun genişlik optimizasyonu - metin sütunu daha geniş, sayı sütunları daha dar */

/* Sütun genişlikleri - daha dengeli dağılım */
.col-sure, .col-ayet {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
}

.col-harf {
    width: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
}

.col-toplam {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
}

.col-metin {
    min-width: 200px !important;
    width: auto !important; /* Genişliği içeriğe göre ayarlar */
}

/* Hücre içeriklerini daha kompakt hale getirme */
.cell-sure, .cell-ayet, .cell-harf, .cell-toplam {
    padding: 0.5rem !important;
    font-size: 0.9rem !important;
}

/* Arapça metin sütunu için daha geniş alan */
.cell-metin {
    min-width: 200px !important;
    width: auto !important;
    max-width: none !important; /* Maksimum genişlik sınırını kaldır */
}

.cell-metin .arabic-text {
    min-width: 200px !important;
    max-width: none !important; /* İçeriğe göre genişlesin */
    width: auto !important;
}

/* Hücre içi boşlukları azalt */
.harf-table td, .harf-table th {
    padding: 0.5rem !important;
}

/* Sayfa genişliğine göre otomatik uyum */
.table-container {
    width: 100% !important;
}

.table-scroll {
    width: 100% !important;
}

/* Sadece ayet sütunu için düzenleme */
.col-ayet {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    text-align: center !important;
}

/* Ayet hücresi için ayarlama */
.cell-ayet {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0.5rem !important;
}

/* Ayet başlığı için ayarlama */
th.col-ayet {
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}
