/* ============================================
   KKU Genel Modal Sistemi - Modern KKU Mavi Tema
   Modern, animasyonlu ve responsive modal
   ============================================ */

/* Modal Overlay */
.kku-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    backdrop-filter: none;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.kku-modal.show {
    display: flex;
}

/* Modal Content */
.kku-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    padding: 0;
    min-width: 400px;
    min-height: 400px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    margin: auto;
    animation: kkuModalPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 51, 102, 0.35);
    border: none;
    transform-origin: center center;
    display: flex;
    flex-direction: column;
}

/* Modal Boyutları */
.kku-modal-content.small {
    min-width: 350px;
    max-width: 400px;
    min-height: 250px;
}

.kku-modal-content.medium {
    min-width: 450px;
    max-width: 600px;
    min-height: 400px;
}

.kku-modal-content.large {
    min-width: 600px;
    max-width: 800px;
    min-height: 400px;
}

.kku-modal-content.xlarge {
    min-width: 800px;
    max-width: 1000px;
    min-height: 500px;
}

.kku-modal-content.fullscreen {
    min-width: 90%;
    max-width: 95%;
    min-height: 90vh;
    max-height: 95vh;
    width: 95%;
}

/* Modal Header */
.kku-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #003366 0%, #004080 50%, #0052a3 100%);
    color: white;
    margin-bottom: 0;
    border-bottom: none;
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

.kku-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.kku-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kku-modal-title::before {
    content: '';
    width: 3px;
    height: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.kku-modal-title i {
    color: rgba(255, 255, 255, 0.9);
}

.kku-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1.25rem;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    line-height: 1;
}

.kku-modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Modal Body */
.kku-modal-body {
    margin-bottom: 0;
    padding: 1.5rem;
    background: white;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
    color: #4a5568;
    line-height: 1.6;
}

/* Modal Footer */
.kku-modal-footer {
    text-align: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 51, 102, 0.08);
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 60px;
}

.kku-modal-footer.left {
    justify-content: flex-start;
}

.kku-modal-footer.right {
    justify-content: flex-end;
}

.kku-modal-footer.space-between {
    justify-content: space-between;
}

/* Modal Butonları */
.kku-modal-btn {
    padding: 0.625rem 1.75rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.kku-modal-btn::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 ease;
}

.kku-modal-btn:hover::before {
    left: 100%;
}

.kku-modal-btn.primary {
    background: linear-gradient(135deg, #003366 0%, #004080 50%, #0052a3 100%);
    color: white;
    box-shadow: 0 3px 12px rgba(0, 51, 102, 0.25);
}

.kku-modal-btn.primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 51, 102, 0.4);
}

.kku-modal-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.kku-modal-btn.secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.kku-modal-btn.success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.kku-modal-btn.success:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(72, 187, 120, 0.4);
}

.kku-modal-btn.danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.kku-modal-btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(245, 101, 101, 0.4);
}

.kku-modal-btn.warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.kku-modal-btn.warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(237, 137, 54, 0.4);
}

.kku-modal-btn.info {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.kku-modal-btn.info:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(66, 153, 225, 0.4);
}

/* Modal İçerik Öğeleri */
.kku-modal-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(0, 51, 102, 0.08);
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0.125rem 0;
}

.kku-modal-detail:hover {
    background: linear-gradient(90deg, rgba(0, 51, 102, 0.03), rgba(0, 51, 102, 0.05));
    transform: translateX(4px);
}

.kku-modal-detail:last-child {
    border-bottom: none;
}

.kku-modal-detail-label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kku-modal-detail-label::before {
    content: '▸';
    color: #003366;
    font-size: 0.7rem;
    opacity: 0.5;
}

.kku-modal-detail-value {
    font-weight: 700;
    color: #003366;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #003366, #004080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Modal Liste */
.kku-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kku-modal-list-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.kku-modal-list-item:last-child {
    border-bottom: none;
}

/* Animasyonlar */
@keyframes kkuModalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes kkuModalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-20px);
    }
    
    50% {
        transform: scale(1.05) translateY(0);
    }
    
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes kkuModalPopOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
}

@keyframes kkuModalSlideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading State */
.kku-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.kku-modal-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: kkuModalSpin 1s linear infinite;
}

@keyframes kkuModalSpin {
    to {
        transform: rotate(360deg);
    }
}

.kku-modal-loading-text {
    color: #718096;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kku-modal-content {
        width: 95%;
        max-width: 95%;
        min-width: 320px;
        min-height: 250px;
        max-height: 85vh;
    }

    .kku-modal-content.small {
        min-width: 300px;
    }

    .kku-modal-content.medium {
        min-width: 350px;
    }

    .kku-modal-title {
        font-size: 1.1rem;
    }

    .kku-modal-header {
        padding: 0.875rem 1.25rem;
        min-height: 50px;
    }

    .kku-modal-body {
        padding: 1.25rem;
    }

    .kku-modal-footer {
        padding: 0.875rem 1.25rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .kku-modal-btn {
        width: 100%;
        justify-content: center;
    }

    .kku-modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .kku-modal-content {
        padding: 0;
        border-radius: 8px;
        min-width: 280px;
        min-height: 200px;
    }

    .kku-modal-content.small,
    .kku-modal-content.medium {
        min-width: 280px;
    }

    .kku-modal-title {
        font-size: 1rem;
    }

    .kku-modal-header {
        padding: 0.75rem 1rem;
    }

    .kku-modal-body {
        padding: 1rem;
    }
}

/* Scrollbar Styling */
.kku-modal-content::-webkit-scrollbar,
.kku-modal-body::-webkit-scrollbar {
    width: 8px;
}

.kku-modal-content::-webkit-scrollbar-track,
.kku-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.kku-modal-content::-webkit-scrollbar-thumb,
.kku-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #003366, #004080);
    border-radius: 4px;
}

.kku-modal-content::-webkit-scrollbar-thumb:hover,
.kku-modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #004080, #0052a3);
}

