/* Modern and responsive styles for English Word Learn */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(79, 70, 229, 0.6);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 70, 229, 0.8);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        margin: 10px;
        padding: 20px;
    }
    
    .game-card {
        padding: 20px;
        margin: 10px 0;
    }
    
    .flash-card-container {
        height: 300px;
    }
    
    .flash-card-front .card-content h2 {
        font-size: 1.8rem;
    }
    
    .flash-card-back .card-content h3 {
        font-size: 1.5rem;
    }
    
    .timer-circle {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
    
    .score-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .leaderboard-item {
        padding: 15px;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .btn-game {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .game-card h3 {
        font-size: 1.3rem;
    }
    
    .category-icon {
        font-size: 1.5rem;
    }
    
    .flash-card-front .card-content h2 {
        font-size: 1.5rem;
    }
    
    .flash-card-back .card-content h3 {
        font-size: 1.3rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .game-card {
        background: rgba(31, 41, 55, 0.95);
        color: white;
    }
    
    .card {
        background: rgba(31, 41, 55, 0.9);
        color: white;
    }
    
    .form-control {
        background: rgba(55, 65, 81, 0.8);
        border-color: rgba(156, 163, 175, 0.3);
        color: white;
    }
    
    .form-control:focus {
        background: rgba(55, 65, 81, 0.9);
        border-color: var(--primary-color);
        color: white;
    }
}

/* Loading animations */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Success and error animations */
.animate-success {
    animation: successPulse 0.6s ease-in-out;
}

.animate-error {
    animation: errorShake 0.6s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); background-color: rgba(16, 185, 129, 0.2); }
    100% { transform: scale(1); }
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.answer-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .game-card {
        border: 2px solid black;
    }
    
    .btn-game {
        border: 2px solid white;
    }
    
    .flash-card-front,
    .flash-card-back {
        border: 2px solid white;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-element,
    .floating-card {
        animation: none !important;
    }
}

/* Utility classes */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.shadow-glow {
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.3);
}

.gradient-text {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Rozet Stilleri */
.badge-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.badge-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.badge-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.badge-item:hover::before {
    left: 100%;
}

.badge-empty {
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.badge-empty:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Rozet animasyonları */
@keyframes badgeEarned {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

.badge-new {
    animation: badgeEarned 0.8s ease-out;
}

/* Rozet tooltip */
.badge-item[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.badge-item[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

/* Kategori Arama Stilleri */
.category-search-container {
    position: relative;
    margin-bottom: 20px;
}

.category-search-input {
    width: 100%;
    padding: 12px 50px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.category-search-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.category-search-input::placeholder {
    color: #aaa;
    font-style: italic;
}

.category-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.category-search-clear:hover {
    background: #f0f0f0;
    color: #333;
}

.category-search-tips {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.category-search-tips small {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Kategori öğeleri */
.category-item {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-item:hover {
    transform: scale(1.05);
    border-color: #4f46e5;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.2);
}

/* Arama sonuç vurgulama */
.category-item mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    color: #333;
}

/* Sonuç bulunamadı mesajı */
.no-result-message {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #ddd;
    transition: all 0.3s ease;
}

.no-result-message:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.no-result-message button {
    background: none;
    border: none;
    color: #4f46e5;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.no-result-message button:hover {
    color: #3730a3;
}

/* Responsive arama */
@media (max-width: 768px) {
    .category-search-input {
        font-size: 16px; /* iOS zoom'u önlemek için */
    }
    
    .category-search-tips {
        flex-direction: column;
        align-items: flex-start;
    }
}
