/**
 * Custom CSS - Teminat Mektubu Takip Sistemi
 * Geliştirici: Vedat Ardil - www.vedatardil.com.tr
 */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Genel Stiller */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

.container-fluid {
    flex: 1;
}

/* Footer */
.footer {
    background-color: var(--light-color);
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Navbar */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* Kartlar */
.card {
    border: none;
    box-shadow: 0 0 10px rgba(0,0,0,.1);
    margin-bottom: 1.5rem;
}

.card-header {
    border-bottom: none;
    padding: 1rem 1.5rem;
}

/* Tablo */
.table-responsive {
    border-radius: 0.25rem;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.9rem;
}

.table tbody tr {
    transition: all 0.2s;
}

.table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Vade renklendirme */
.table-success {
    background-color: #d1e7dd !important;
}

.table-warning {
    background-color: #fff3cd !important;
}

.table-danger {
    background-color: #f8d7da !important;
}

/* Butonlar */
.btn {
    border-radius: 0.25rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
}

.btn-group .btn {
    margin: 0 2px;
}

/* Form */
.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, .25);
}

.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    display: block;
    font-size: 0.875rem;
}

/* Alert */
.alert {
    border-radius: 0.25rem;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.alert-dismissible .btn-close {
    padding: 0.75rem;
}

/* Badge */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Modal */
.modal-content {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

.modal-header {
    border-bottom: none;
    padding: 1.5rem;
}

.modal-footer {
    border-top: none;
    padding: 1.5rem;
}

/* Giriş Sayfası */
.card-body.p-5 {
    padding: 3rem !important;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin: 2px 0;
    }
    
    .card-body.p-5 {
        padding: 2rem !important;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Özel Animasyonlar */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert {
    animation: fadeIn 0.3s ease-in-out;
}

/* Dosya Input */
.form-control[type="file"] {
    padding: 0.5rem;
}

/* Text Utilities */
.text-end {
    text-align: right;
}

/* Tablo içi linkler */
.table a {
    text-decoration: none;
}

.table a:hover {
    text-decoration: underline;
}

/* Sıralanabilir Tablo Başlıkları */
.table thead th a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white !important;
    text-decoration: none;
    transition: all 0.2s;
    user-select: none;
}

.table thead th a:hover {
    text-decoration: none;
    opacity: 0.8;
}

.table thead th a i {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.table thead th a:hover i {
    transform: scale(1.2);
}

/* Aktif sıralama kolonu vurgusu */
.table thead th a:has(.bi-arrow-up),
.table thead th a:has(.bi-arrow-down) {
    font-weight: 700;
}

/* Sıralama iconları */
.table thead th .bi-arrow-up,
.table thead th .bi-arrow-down {
    font-weight: bold;
}

.table thead th .bi-arrow-down-up {
    opacity: 0.4;
    font-size: 0.65rem;
}

/* Print Stili */
@media print {
    .navbar,
    .btn,
    .footer,
    .alert {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .table {
        font-size: 10pt;
    }
}

/* Dosya Önizleme Alanı */
#dosyaOnizlemeAlani {
    animation: fadeIn 0.3s ease-in;
}

#dosyaOnizlemeAlani .card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-left: 4px solid var(--primary-color);
}

#dosyaOnizlemeAlani img {
    background-color: #f8f9fa;
    padding: 0.5rem;
    transition: transform 0.3s ease;
}

#dosyaOnizlemeAlani img:hover {
    transform: scale(1.05);
    cursor: pointer;
}

#dosyaOnizlemeAlani .btn-danger {
    transition: all 0.3s ease;
}

#dosyaOnizlemeAlani .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Mevcut Dosya Önizlemesi */
.card .bi-file-earmark-image {
    font-size: 1.2rem;
}

/* Fade In Animasyonu */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tom Select Özel Stiller */
.ts-wrapper {
    width: 100%;
}

.ts-wrapper .ts-control {
    border: 1px solid #ced4da;
    padding: 0.375rem 0.75rem;
    min-height: 38px;
}

.ts-wrapper.single .ts-control {
    background-color: #fff;
}

.ts-wrapper .ts-control input {
    font-size: 1rem;
}

.ts-dropdown {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.ts-dropdown .option.active {
    background-color: var(--primary-color);
    color: white;
}

.ts-dropdown .option:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Tom Select Clear Button */
.ts-wrapper .clear-button {
    margin: 0 4px 0 0;
    padding: 0 6px;
    font-size: 1.2em;
    cursor: pointer;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Bildirim Dropdown Stilleri */
.bildirim-dropdown {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    width: 380px !important;
    max-width: 90vw !important;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
    right: 0 !important;
    left: auto !important;
}

@media (max-width: 576px) {
    .bildirim-dropdown {
        width: 320px !important;
        max-width: 95vw !important;
    }
}

.bildirim-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.bildirim-item .small,
.bildirim-item strong {
    display: block;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
}

.bildirim-item p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.bildirim-item .flex-grow-1 {
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex: 1;
}

.bildirim-item .d-flex {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bildirim-item .d-flex.justify-content-between {
    flex-wrap: wrap;
    gap: 0.25rem;
}

.bildirim-item .d-flex.justify-content-between strong {
    flex: 1;
    min-width: 0;
    padding-right: 0.5rem;
}

.bildirim-item:hover {
    background-color: #f8f9fa;
}

.bildirim-item:last-child {
    border-bottom: none;
}

.bildirim-okunmadi {
    background-color: #e7f3ff;
}

.bildirim-okunmadi:hover {
    background-color: #d0e7ff;
}

/* Bildirim Badge Animasyonu */
@keyframes badgePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.badge.rounded-pill {
    animation: badgePulse 2s infinite;
}

/* Bildirim Dropdown Scrollbar */
.bildirim-dropdown::-webkit-scrollbar {
    width: 6px;
}

.bildirim-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.bildirim-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.bildirim-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Bildirim Icon Hover */
#bildirimMenu:hover {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* Bildirim Sayacı Özel Stil */
.position-relative .badge {
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Yeni Bildirim Animasyonu */
@keyframes yeniBildirim {
    0% {
        background-color: #fff3cd;
        transform: translateX(10px);
    }
    100% {
        background-color: #e7f3ff;
        transform: translateX(0);
    }
}

.yeni-bildirim {
    animation: yeniBildirim 0.5s ease-out;
}

/* Bildirim Çan Animasyonu */
@keyframes bellRing {
    0% { transform: rotate(0); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(10deg); }
    40% { transform: rotate(-10deg); }
    50% { transform: rotate(5deg); }
    60% { transform: rotate(-5deg); }
    70% { transform: rotate(0); }
    100% { transform: rotate(0); }
}

.bell-ring {
    animation: bellRing 0.8s ease-in-out;
}

/* Gelecek 10 Gün Özet Kartı */
.bildirim-dropdown .ozet-kart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin: 0.5rem;
    padding: 0.75rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.bildirim-dropdown .ozet-kart .row {
    font-size: 0.85rem;
}

.bildirim-dropdown .ozet-kart .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Özet kart hover efekti */
.bildirim-dropdown .ozet-kart:hover {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Toast Bildirimleri */
#toastContainer {
    z-index: 9999 !important;
}

#toastContainer .toast {
    min-width: 300px;
    max-width: 400px;
    animation: slideInRight 0.4s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#toastContainer .toast .toast-body {
    padding: 1rem;
}

#toastContainer .toast .bi {
    flex-shrink: 0;
}

/* Toast giriş animasyonu */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Toast çıkış animasyonu */
@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

#toastContainer .toast.hiding {
    animation: slideOutRight 0.3s ease-in;
}

/* Toast renk varyasyonları */
#toastContainer .toast.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

#toastContainer .toast.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
}

#toastContainer .toast.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%) !important;
}

#toastContainer .toast.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
}

/* Toast hover efekti */
#toastContainer .toast:hover {
    transform: translateX(-5px);
    transition: transform 0.2s ease;
    cursor: pointer;
}

