/**
 * Modern Modal System
 * Tüm frontend modallar için genel tasarım sistemi
 */

/* Modal Overlay */
.modern-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 20px;
}

.modern-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.modern-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 480px;
    width: 100%;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modern-modal-overlay.active .modern-modal {
    transform: scale(1) translateY(0);
}

/* Modal Sizes */
.modern-modal.modal-sm {
    max-width: 360px;
}

.modern-modal.modal-md {
    max-width: 480px;
}

.modern-modal.modal-lg {
    max-width: 640px;
}

/* Modal Header */
.modern-modal-header {
    background: linear-gradient(135deg, var(--cprimary-color), var(--cprimary-dark));
    padding: 24px;
    text-align: center;
    position: relative;
}

/* Modal Countdown */
.modern-modal-countdown {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.modern-modal-countdown i {
    font-size: 16px;
    animation: spin 2s linear infinite;
}

.countdown-text {
    min-width: 24px;
    text-align: center;
}

/* Header Variants */
.modern-modal-header.header-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.modern-modal-header.header-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.modern-modal-header.header-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.modern-modal-header.header-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.modern-modal-header.header-firebase {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

/* Modal Icon */
.modern-modal-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: pulse 2s infinite;
}

.modern-modal-icon i {
    font-size: 32px;
    color: #ffffff;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }
}

/* Modal Title */
.modern-modal-title {
    color: #ffffff;
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Close Button */
.modern-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    font-size: 18px;
}

.modern-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Modal Body */
.modern-modal-body {
    padding: 32px 24px;
}

.modern-modal-message {
    color: #334155;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
}

/* Info Box */
.modern-modal-info {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.modern-modal-info::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.modern-modal-info-label {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.modern-modal-info-value {
    color: var(--cprimary-color);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

/* Details Grid */
.modern-modal-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.modern-modal-detail-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.modern-modal-detail-label {
    color: #64748b;
    font-size: 12px;
    margin-bottom: 4px;
}

.modern-modal-detail-value {
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
}

.modern-modal-detail-value.success {
    color: #10b981;
}

.modern-modal-detail-value.error {
    color: #ef4444;
}

.modern-modal-detail-value.warning {
    color: #f59e0b;
}

/* Warning/Alert Box */
.modern-modal-alert {
    border-left: 4px solid;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: start;
    gap: 12px;
}

.modern-modal-alert.alert-warning {
    background: #fef3c7;
    border-color: #f59e0b;
}

.modern-modal-alert.alert-error {
    background: #fee2e2;
    border-color: #ef4444;
}

.modern-modal-alert.alert-info {
    background: #dbeafe;
    border-color: #3b82f6;
}

.modern-modal-alert.alert-success {
    background: #d1fae5;
    border-color: #10b981;
}

.modern-modal-alert i {
    font-size: 20px;
    margin-top: 2px;
}

.modern-modal-alert.alert-warning i {
    color: #f59e0b;
}

.modern-modal-alert.alert-error i {
    color: #ef4444;
}

.modern-modal-alert.alert-info i {
    color: #3b82f6;
}

.modern-modal-alert.alert-success i {
    color: #10b981;
}

.modern-modal-alert-text {
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
}

.modern-modal-alert.alert-warning .modern-modal-alert-text {
    color: #92400e;
}

.modern-modal-alert.alert-error .modern-modal-alert-text {
    color: #991b1b;
}

.modern-modal-alert.alert-info .modern-modal-alert-text {
    color: #1e40af;
}

.modern-modal-alert.alert-success .modern-modal-alert-text {
    color: #065f46;
}

/* Modal Actions */
.modern-modal-actions {
    display: flex;
    gap: 12px;
}

.modern-modal-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modern-modal-btn i {
    font-size: 18px;
}

/* Button Variants */
.modern-modal-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.modern-modal-btn-cancel:hover {
    background: #e2e8f0;
    color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modern-modal-btn-primary {
    background: linear-gradient(135deg, var(--cprimary-color), var(--cprimary-dark));
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.modern-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.5);
}

.modern-modal-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.modern-modal-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.modern-modal-btn-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.modern-modal-btn-error:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.modern-modal-btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.modern-modal-btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.modern-modal-btn:active {
    transform: translateY(0);
}

.modern-modal-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.modern-modal-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 576px) {
    .modern-modal {
        max-width: calc(100% - 32px);
        margin: 16px;
    }
    
    .modern-modal-header {
        padding: 20px;
    }
    
    .modern-modal-body {
        padding: 24px 20px;
    }
    
    .modern-modal-icon {
        width: 56px;
        height: 56px;
    }
    
    .modern-modal-icon i {
        font-size: 28px;
    }
    
    .modern-modal-title {
        font-size: 20px;
    }
    
    .modern-modal-info-value {
        font-size: 20px;
    }
    
    .modern-modal-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .modern-modal-actions {
        flex-direction: column-reverse;
    }
    
    .modern-modal-btn {
        width: 100%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modern-modal {
        background: #1e293b;
    }
    
    .modern-modal-message {
        color: #cbd5e1;
    }
    
    .modern-modal-info {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
        border-color: #475569;
    }
    
    .modern-modal-info-label {
        color: #94a3b8;
    }
    
    .modern-modal-detail-item {
        background: #334155;
    }
    
    .modern-modal-detail-label {
        color: #94a3b8;
    }
    
    .modern-modal-detail-value {
        color: #e2e8f0;
    }
    
    .modern-modal-btn-cancel {
        background: #334155;
        color: #cbd5e1;
    }
    
    .modern-modal-btn-cancel:hover {
        background: #475569;
        color: #e2e8f0;
    }
}

