/**
 * Kort Sistemi CSS Stilleri
 * JavaScript işlevselliği için animasyonlar ve stiller
 */

/* ==========================================================================
   Kort Seçimi Stilleri
   ========================================================================== */

.kort-selection-container {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background: #fafafa;
}

.kort-card {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    overflow: hidden;
}

.kort-card:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.kort-card.selected {
    border-color: #007bff;
    background-color: #e7f3ff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.kort-card.unavailable {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
    border-color: #6c757d;
}

.kort-card.unavailable:hover {
    transform: none;
    box-shadow: none;
}

.kort-selection-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #007bff;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kort-card.selected .kort-selection-indicator {
    opacity: 1;
}

/* Kort bilgileri */
.kort-info h6 {
    margin-bottom: 4px;
    color: #333;
    font-weight: 600;
}

.kort-details {
    font-size: 0.85rem;
}

/* ==========================================================================
   Animasyonlar
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* Animasyon sınıfları */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in-animation {
    animation: slideIn 0.3s ease-out;
}

.fade-in-animation {
    animation: fadeIn 0.3s ease-out;
}

.animate-selection {
    animation: pulse 0.3s ease-out;
}

.price-update-animation {
    animation: fadeIn 0.4s ease-out;
}

.stats-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.content-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.new-item-animation {
    animation: slideIn 0.4s ease-out;
}

.list-update-animation {
    animation: fadeIn 0.3s ease-out;
}

.cell-hover {
    background-color: #f0f8ff !important;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* ==========================================================================
   Haftalık Takvim Stilleri
   ========================================================================== */

.takvim-table {
    font-size: 0.85rem;
    border-collapse: separate;
    border-spacing: 0;
}

.takvim-hucre {
    height: 80px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: top;
    padding: 6px;
    border: 1px solid #dee2e6;
}

.takvim-hucre:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
    z-index: 1;
}

.takvim-hucre.bugun {
    background-color: #fff3cd;
    border-color: #ffc107;
}

.takvim-hucre.rezervasyon-yapilamaz {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

.takvim-hucre.musait {
    background-color: #d4edda;
    border-color: #28a745;
}

.takvim-hucre.rezervasyon-var {
    background-color: #cce5ff;
    border-color: #007bff;
}

.takvim-hucre.dolu {
    background-color: #f8d7da;
    border-color: #dc3545;
}

.hucre-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.rezervasyon-count {
    text-align: center;
    margin-bottom: 4px;
}

.rezervasyon-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    padding: 2px 6px;
    margin-bottom: 2px;
    font-size: 0.75rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.rezervasyon-item:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(2px);
}

.rezervasyon-item.beklemede {
    border-left-color: #ffc107;
    background-color: rgba(255, 193, 7, 0.1);
}

.rezervasyon-item.onaylandı {
    border-left-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}


.rezervasyon-item.iptal {
    border-left-color: #6c757d;
    background-color: rgba(108, 117, 125, 0.1);
}

.rezervasyon-item.tamamlandı {
    border-left-color: #17a2b8;
    background-color: rgba(23, 162, 184, 0.1);
}

.rezervasyon-item.ertelendi {
    border-left-color: #fd7e14;
    background-color: rgba(253, 126, 20, 0.1);
}

/* Rezervasyon durum badge'leri */
.rezervasyon-durum-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.6rem;
    line-height: 1;
}

.rezervasyon-durum-badge .badge {
    padding: 2px 4px;
    font-size: 0.6rem;
    border-radius: 3px;
    font-weight: bold;
}

.musait-info, .dolu-info {
    text-align: center;
    margin-top: auto;
    padding: 4px;
}

.rezervasyon-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.takvim-hucre:hover .rezervasyon-btn {
    opacity: 1;
}

.rezervasyon-btn a {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    text-decoration: none;
}

/* ==========================================================================
   Stat Card Stilleri
   ========================================================================== */

.stat-card {
    background: white;
    color: black;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 1px solid #e9ecef;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}


.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.stat-label {
    font-size: 0.9rem;
    color: black;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ==========================================================================
   Çoklu Rezervasyon Stilleri
   ========================================================================== */

.kort-selection-area {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}

.kort-option {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    position: relative;
}

.kort-option:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
    transform: translateY(-1px);
}

.kort-option.selected {
    border-color: #007bff;
    background-color: #e7f3ff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.kort-option .selection-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #007bff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.kort-option.selected .selection-indicator {
    opacity: 1;
}

.rezervasyon-list {
    max-height: 400px;
    overflow-y: auto;
}

.rezervasyon-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    position: relative;
    background: white;
    transition: all 0.2s ease;
}

.rezervasyon-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.rezervasyon-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #dc3545;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rezervasyon-item .remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

.reservation-header {
    font-weight: 600;
    color: #333;
}

.reservation-details {
    font-size: 0.9rem;
    color: #666;
}

/* ==========================================================================
   Modal Stilleri
   ========================================================================== */

.time-slot-stats .stat-card {
    padding: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.time-slot-stats .stat-number {
    font-size: 1.5rem;
}

.reservations-section,
.available-courts-section {
    margin-bottom: 20px;
}

.section-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.reservation-row:hover {
    background-color: #f8f9fa;
}

.court-details {
    font-size: 0.85rem;
}

/* ==========================================================================
   Loading Stilleri
   ========================================================================== */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* ==========================================================================
   Responsive Stilleri
   ========================================================================== */

@media (max-width: 768px) {
    .takvim-table.mobile-layout {
        font-size: 0.75rem;
    }
    
    .takvim-hucre {
        height: 60px;
        padding: 4px;
    }
    
    .hucre-content.mobile-content {
        font-size: 0.7rem;
    }
    
    .stat-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .kort-card {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .rezervasyon-item {
        padding: 10px;
        margin-bottom: 8px;
    }
}

@media (max-width: 576px) {
    .takvim-hucre {
        height: 50px;
        padding: 2px;
    }
    
    .rezervasyon-item {
        font-size: 0.85rem;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-number {
        font-size: 1.3rem;
    }
    
    .kort-selection-container,
    .kort-selection-area {
        max-height: 200px;
    }
}

/* ==========================================================================
   Erişilebilirlik
   ========================================================================== */

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus stilleri */
.kort-card:focus,
.kort-option:focus,
.rezervasyon-item:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode desteği */
@media (prefers-contrast: high) {
    .kort-card,
    .kort-option,
    .rezervasyon-item {
        border-width: 2px;
    }
    
    .takvim-hucre {
        border-width: 2px;
    }
}

/* Reduced motion desteği */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Print Stilleri
   ========================================================================== */

@media print {
    .rezervasyon-btn,
    .remove-btn,
    .btn,
    .modal {
        display: none !important;
    }
    
    .takvim-hucre {
        border: 1px solid #000 !important;
        background: white !important;
    }
    
    .stat-card {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
    }
}

/* ==========================================================================
   Tema Desteği
   ========================================================================== */

[data-theme="dark"] .kort-card,
[data-theme="dark"] .kort-option,
[data-theme="dark"] .rezervasyon-item {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .kort-card:hover,
[data-theme="dark"] .kort-option:hover {
    background: #4a5568;
    border-color: #63b3ed;
}

[data-theme="dark"] .kort-card.selected,
[data-theme="dark"] .kort-option.selected {
    background: #2c5282;
    border-color: #63b3ed;
}

[data-theme="dark"] .takvim-hucre {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .stat-card {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}