/* KamuTercih Custom CSS */

/* KOYU MOD ENGELLEMESİ - Global seviyede */
:root {
    color-scheme: light only !important;
    --kt-primary: #206bc4;
    --kt-primary-rgb: 32, 107, 196;
    --kt-success: #2fb344;
    --kt-warning: #f76707;
    --kt-danger: #d63384;
    --kt-info: #4299e1;
    --kt-dark: #1e293b;
    --kt-light: #f8fafc;
}

/* Tüm elementleri açık modda zorla - Alert'ler hariç */
*:not([data-alert-type]), *:not([data-alert-type])::before, *:not([data-alert-type])::after {
    color-scheme: light only !important;
}

/* Alert'ler için özel muafiyet - Güçlü kurallar */
[data-alert-type="modern"] {
    color-scheme: normal !important;
}

[data-alert-type="modern"], 
[data-alert-type="modern"] *,
[data-alert-type="modern"] *::before,
[data-alert-type="modern"] *::after {
    color-scheme: normal !important;
    background-color: inherit !important;
    color: inherit !important;
}

/* Alert'lerin kendi renklerini koruma */
[data-alert-type="modern"][style*="background-color"] {
    background-color: var(--alert-bg-color) !important;
}

[data-alert-type="modern"][style*="color"] {
    color: var(--alert-text-color) !important;
}

/* Global Styles */
body {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Card enhancements - Koyu mod korumalı */
.card {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}

.card:hover {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
    transform: translateY(-2px);
}

.card-sm {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-body, .card-header, .card-footer {
    background-color: transparent !important;
    color: #1f2937 !important;
}

.card-title {
    color: #1f2937 !important;
}

.card-text {
    color: #6b7280 !important;
}

/* Özel kart başlık renkleri - yerleştirme durumuna göre */
.card.bg-success .card-title,
.card-success .card-title,
.text-success.card-title,
.card-header.bg-success .card-title,
.card-header.bg-success h3.card-title,
.card-header.bg-success h3.card-title span,
.card-header.bg-success .card-title span {
    color: #ffffff !important;
    background-color: transparent !important;
}

.card.bg-danger .card-title,
.card-danger .card-title,
.text-danger.card-title,
.card-header.bg-danger .card-title,
.card-header.bg-danger h3.card-title,
.card-header.bg-danger h3.card-title span,
.card-header.bg-danger .card-title span {
    color: #ffffff !important;
    background-color: transparent !important;
}

.card.bg-warning .card-title,
.card-warning .card-title,
.text-warning.card-title,
.card-header.bg-warning .card-title,
.card-header.bg-warning h3.card-title,
.card-header.bg-warning h3.card-title span,
.card-header.bg-warning .card-title span {
    color: #000000 !important;
    background-color: transparent !important;
}

.card.bg-info .card-title,
.card-info .card-title,
.text-info.card-title,
.card-header.bg-info .card-title,
.card-header.bg-info h3.card-title,
.card-header.bg-info h3.card-title span,
.card-header.bg-info .card-title span {
    color: #ffffff !important;
    background-color: transparent !important;
}

.card.bg-primary .card-title,
.card-primary .card-title,
.text-primary.card-title,
.card-header.bg-primary .card-title,
.card-header.bg-primary h3.card-title,
.card-header.bg-primary h3.card-title span,
.card-header.bg-primary .card-title span {
    color: #ffffff !important;
    background-color: transparent !important;
}

/* Kart header arka planlarını koruma */
.card-header.bg-success {
    background-color: #059669 !important;
    color: #ffffff !important;
}

.card-header.bg-danger {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

.card-header.bg-warning {
    background-color: #f59e0b !important;
    color: #000000 !important;
}

.card-header.bg-info {
    background-color: #0284c7 !important;
    color: #ffffff !important;
}

.card-header.bg-primary {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* Kart içeriğindeki renkli başlıklar */
.card-body h4.text-success,
.card-body .text-success {
    color: #059669 !important;
}

.card-body h4.text-danger,
.card-body .text-danger {
    color: #dc2626 !important;
}

.card-body h4.text-warning,
.card-body .text-warning {
    color: #d97706 !important;
}

.card-body h4.text-info,
.card-body .text-info {
    color: #0284c7 !important;
}

.card-body h4.text-primary,
.card-body .text-primary {
    color: #2563eb !important;
}

/* Link'lerin renklerini koruma */
.card-body a.text-success,
.card-body a.text-success:hover,
.card-body a.text-success:focus {
    color: #059669 !important;
}

.card-body a.text-danger,
.card-body a.text-danger:hover,
.card-body a.text-danger:focus {
    color: #dc2626 !important;
}

.card-body a.text-warning,
.card-body a.text-warning:hover,
.card-body a.text-warning:focus {
    color: #d97706 !important;
}

.card-body a.text-info,
.card-body a.text-info:hover,
.card-body a.text-info:focus {
    color: #0284c7 !important;
}

.card-body a.text-primary,
.card-body a.text-primary:hover,
.card-body a.text-primary:focus {
    color: #2563eb !important;
}

/* Button enhancements */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--kt-primary) 0%, #1e40af 100%);
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--kt-success) 0%, #16a34a 100%);
    border: none;
}

/* Glassmorphism effects */
.glassmorphism {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

.glassmorphism-dark {
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

/* Navbar enhancements */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--kt-primary), var(--kt-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Avatar enhancements */
.avatar {
    border-radius: 12px;
    transition: all 0.3s ease;
}

.avatar:hover {
    transform: scale(1.05);
}

/* Status dots with animations */
.status-dot-animated {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(32, 107, 196, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(32, 107, 196, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(32, 107, 196, 0);
    }
}

/* Progress bar enhancements */
.progress {
    height: 8px;
    border-radius: 10px;
    overflow: hidden;
    background-color: rgba(32, 107, 196, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--kt-primary), var(--kt-info));
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* Alert enhancements */
.alert {
    border-radius: 8px !important;
    border: 1px solid !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    color-scheme: light only !important;
}

.alert-success {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    border-color: #a7f3d0 !important;
}

.alert-warning {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fde68a !important;
}

.alert-danger {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fecaca !important;
}

.alert-info {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border-color: #bfdbfe !important;
}

/* Form enhancements - Koyu mod korumalı */
.form-control {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-radius: 8px;
    border: 1px solid #e2e8f0 !important;
    transition: all 0.3s ease;
    padding: 0.75rem 1rem;
}

.form-control:focus {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-color: var(--kt-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(32, 107, 196, 0.15) !important;
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #9ca3af !important;
}

.form-select {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-radius: 8px;
    border: 1px solid #e2e8f0 !important;
    padding: 0.75rem 1rem;
}

.form-select:focus {
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-color: var(--kt-primary) !important;
}

/* Input grupları için özel kurallar */
.input-group .form-control {
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

.input-group-text {
    background-color: #f8fafc !important;
    color: #1f2937 !important;
    border-color: #e2e8f0 !important;
}

/* Form-check-input (Switch) düzeltmeleri - Koyu mod korumalı */
.form-check-input {
    color-scheme: light only !important;
    background-color: #e5e7eb !important;
    border-color: #d1d5db !important;
}

.form-check-input:checked {
    background-color: #206bc4 !important;
    border-color: #206bc4 !important;
}

.form-check-input:focus {
    border-color: #206bc4 !important;
    box-shadow: 0 0 0 0.25rem rgba(32, 107, 196, 0.25) !important;
}

.form-switch .form-check-input {
    background-color: #e5e7eb !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}

.form-switch .form-check-input:checked {
    background-color: #206bc4 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}

/* Disabled input'lar için özel stiller */
.form-control:disabled,
.form-control[readonly] {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    opacity: 1 !important;
}

.form-select:disabled {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    border-color: #d1d5db !important;
    opacity: 1 !important;
}

/* Table enhancements - Koyu mod korumalı */
.table {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table thead th {
    color-scheme: light only !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    color: #374151 !important;
    border-bottom: 2px solid #e2e8f0 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.table tbody tr {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8fafc !important;
    color: #1f2937 !important;
    transform: scale(1.01);
}

.table tbody td {
    color: #1f2937 !important;
    background-color: transparent !important;
}

/* Tablo içindeki link'ler */
.table a {
    color: #206bc4 !important;
}

.table a:hover {
    color: #1e40af !important;
}

/* Badge enhancements */
.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Mobile bottom navigation - Koyu mod korumalı */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        color-scheme: light only !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(0, 0, 0, 0.1);
        z-index: 1000;
        padding: 0.5rem 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-bottom-nav .nav-link {
        color-scheme: light only !important;
        padding: 0.5rem;
        text-align: center;
        color: #64748b !important;
        text-decoration: none;
        font-size: 0.75rem;
        transition: all 0.3s ease;
        border-radius: 8px;
        margin: 0 0.25rem;
    }
    
    .mobile-bottom-nav .nav-link.active {
        color: var(--kt-primary) !important;
        background: rgba(32, 107, 196, 0.1) !important;
    }
    
    .mobile-bottom-nav .nav-link:hover {
        color: var(--kt-primary) !important;
        background: rgba(32, 107, 196, 0.05) !important;
        transform: translateY(-2px);
    }
    
    .mobile-bottom-nav .nav-link i {
        display: block;
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }
    
    .page-body {
        padding-bottom: 80px;
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--kt-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Drag and drop styles */
.sortable-ghost {
    opacity: 0.4;
    background: #f8fafc;
}

.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.drag-handle {
    cursor: grab;
    color: #94a3b8;
    transition: color 0.3s ease;
}

.drag-handle:hover {
    color: var(--kt-primary);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Notification styles */
.notification-item {
    padding: 1rem;
    border-left: 4px solid var(--kt-primary);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    margin-bottom: 0.5rem;
    border-radius: 0 8px 8px 0;
    transition: all 0.3s ease;
}

.notification-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.notification-item.unread {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: var(--kt-info);
}

/* Statistics cards */
.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--kt-primary), var(--kt-info));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--kt-primary), var(--kt-info));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ek Koyu Mod Düzeltmeleri - Diğer UI Elementleri */

/* Modal ve Alert düzeltmeleri - Koyu mod korumalı */
.modal-content, .modal-header, .modal-body, .modal-footer {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

.modal-title {
    color: #1f2937 !important;
}

/* Modern Alert Stilleri birleştirildi - yukarıdaki alert tanımları ile */

/* Position-fixed alert'ler için özel stiller */
.alert.position-fixed {
    top: 20px !important;
    right: 20px !important;
    z-index: 9999 !important;
    max-width: 400px !important;
    min-width: 300px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Alert dismiss button */
.alert .btn-close {
    background-color: transparent !important;
    opacity: 0.7 !important;
}

.alert .btn-close:hover {
    opacity: 1 !important;
}

/* Pagination düzeltmeleri */
.page-link {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #206bc4 !important;
    border-color: #e2e8f0 !important;
}

.page-link:hover {
    background-color: #f8fafc !important;
    color: #1e40af !important;
    border-color: #d1d5db !important;
}

.page-item.active .page-link {
    background-color: #206bc4 !important;
    border-color: #206bc4 !important;
    color: #ffffff !important;
}

/* Badge düzeltmeleri */
.badge {
    color-scheme: light only !important;
}

.badge.bg-success {
    background-color: #10b981 !important;
    color: #ffffff !important;
}

.badge.bg-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
}

.badge.bg-warning {
    background-color: #f59e0b !important;
    color: #ffffff !important;
}

.badge.bg-secondary {
    background-color: #6b7280 !important;
    color: #ffffff !important;
}

/* Breadcrumb düzeltmeleri */
.breadcrumb {
    background-color: #f8fafc !important;
}

.breadcrumb-item a {
    color: #206bc4 !important;
}

.breadcrumb-item.active {
    color: #6b7280 !important;
}

/* Progress bar düzeltmeleri */
.progress {
    background-color: #e5e7eb !important;
}

.progress-bar {
    background-color: #206bc4 !important;
}

/* Toast düzeltmeleri */
.toast {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
    border: 1px solid #e2e8f0 !important;
}

.toast-header {
    background-color: #f8fafc !important;
    color: #1f2937 !important;
}

/* Offcanvas düzeltmeleri */
.offcanvas, .offcanvas-header, .offcanvas-body {
    color-scheme: light only !important;
    background-color: #ffffff !important;
    color: #1f2937 !important;
}

/* Print styles */
@media print {
    .mobile-bottom-nav,
    .btn,
    .navbar {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    .page-body {
        padding-bottom: 0;
    }
}
