* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

header h1 {
    padding: 20px;
    color: #667eea;
    text-align: center;
    font-size: 2em;
}

.main-content {
    background-color: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-section {
    margin-bottom: 30px;
}

.input-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.input-group label {
    font-weight: 600;
    color: #555;
}

.input-group input[type="number"] {
    padding: 12px 20px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    width: 120px;
    text-align: center;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary, .btn-secondary {
    padding: 14px 35px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 117, 125, 0.4);
}

.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.loading-spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #f5c6cb;
}

.kelime-grid {
    margin-top: 30px;
}

.kelime-grid h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.kelime-sayisi {
    background-color: #e7f3ff;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #0066cc;
}

.kelime-listesi {
    display: grid;
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
    padding: 10px;
    /* Grid template columns JavaScript ile dinamik olarak ayarlanacak */
}

/* Mobil cihazlar için responsive */
@media (max-width: 768px) {
    .kelime-listesi {
        grid-template-columns: 1fr !important;
    }
    
    .main-content {
        padding: 20px;
        border-radius: 15px;
    }
    
    .input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .input-group input[type="number"] {
        width: 100%;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .istatistik-bolumu {
        padding: 30px 0;
    }
    
    .istatistik-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }
    
    .kullanim-bilgisi {
        font-size: 12px;
    }
    
    .harf-kutusu {
        min-width: 30px;
        width: 30px;
        height: 30px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
        padding: 15px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .istatistik-bolumu {
        padding: 25px 0;
    }
    
    .toplam-kelime {
        padding: 20px;
    }
    
    .istatistik-deger {
        font-size: 28px;
    }
}

.kelime-item {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 100%;
    min-width: fit-content;
}

.kelime-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.harf-kutusu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-weight: bold;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.harf-kutusu::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.3) 0%, transparent 70%);
}

.harf-kutusu:hover::after {
    opacity: 1;
}

.harf-kutusu:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
    z-index: 10;
}

.harf-kutusu.secili {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.6), 0 4px 10px rgba(40, 167, 69, 0.3);
    transform: scale(1.05);
    animation: pulseGreen 2s ease-in-out infinite;
}

@keyframes pulseGreen {
    0%, 100% {
        box-shadow: 0 0 15px rgba(40, 167, 69, 0.6), 0 4px 10px rgba(40, 167, 69, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(40, 167, 69, 0.8), 0 6px 15px rgba(40, 167, 69, 0.5);
    }
}

.harf-kutusu.yasak {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-color: #dc3545;
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.6), 0 4px 10px rgba(220, 53, 69, 0.3);
    opacity: 0.85;
    transform: scale(0.95);
}

.harf-kutusu.yasak:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    border-color: #c82333;
    opacity: 1;
    transform: scale(1.05);
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 18px;
}

.filtre-bilgisi {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: 12px;
    border: 2px solid #ffc107;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.kullanim-bilgisi {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kullanim-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kullanim-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.kullanim-icon.sol-tik {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 2px 5px rgba(40, 167, 69, 0.4);
}

.kullanim-icon.sag-tik {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 2px 5px rgba(220, 53, 69, 0.4);
}

.filtre-bilgisi h3 {
    color: #856404;
    margin-bottom: 15px;
}

#aktifFiltreler {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.aktif-filtre {
    background-color: #ffc107;
    color: #856404;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
}

.yasak-filtre {
    background-color: #dc3545;
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 600;
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
}

footer {
    margin-top: 0;
    padding: 25px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
    text-align: center;
    color: #6c757d;
    border-radius: 0;
    border-top: 2px solid #e9ecef;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.istatistik-bolumu {
    margin-top: 50px;
    padding: 40px 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 249, 250, 0.98) 100%);
    border-radius: 0;
    border-top: 3px solid #667eea;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.istatistik-bolumu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.istatistik-bolumu .container {
    position: relative;
    z-index: 1;
}

.istatistik-bolumu h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
}

.istatistik-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.toplam-kelime {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4), inset 0 2px 10px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.toplam-kelime::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.istatistik-label {
    font-size: 18px;
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

.istatistik-deger {
    font-size: 36px;
    font-weight: bold;
    display: block;
}

.harf-sayisi-istatistikleri h4 {
    color: #495057;
    margin-bottom: 15px;
    text-align: center;
}

.istatistik-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.istatistik-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 15px 18px;
    border-radius: 12px;
    border: 2px solid #dee2e6;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.istatistik-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.istatistik-item:hover::before {
    left: 100%;
}

.istatistik-item:hover {
    border-color: #667eea;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
}

.harf-sayisi {
    font-size: 14px;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 5px;
}

.istatistik-item .kelime-sayisi {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

/* Scrollbar stilleri */
.kelime-listesi::-webkit-scrollbar {
    width: 10px;
}

.kelime-listesi::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.kelime-listesi::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

.kelime-listesi::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* İstatistik scrollbar stilleri */
.istatistik-grid::-webkit-scrollbar {
    width: 8px;
}

.istatistik-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.istatistik-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 5px;
}

.istatistik-grid::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Loading Overlay Stilleri */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 40px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-content h2 {
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.loading-content p {
    font-size: 16px;
    margin-bottom: 30px;
    opacity: 0.9;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #ffffff 0%, #f0f0f0 50%, #ffffff 100%);
    background-size: 200% 100%;
    border-radius: 15px;
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 15px rgba(255, 255, 255, 0.6), inset 0 2px 5px rgba(255, 255, 255, 0.8);
    animation: progressPulse 1.5s ease-in-out infinite, progressShine 2s linear infinite;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes progressShine {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 2px 10px rgba(255, 255, 255, 0.5);
    }
    50% {
        box-shadow: 0 2px 20px rgba(255, 255, 255, 0.8);
    }
}

.loading-status {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}
