/* =============================================
   MODERN TOAST NOTIFICATION SYSTEM
   YDA Sınav Sistemi v4.0
   ============================================= */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    pointer-events: none;
}

/* Toast Base */
.custom-toast {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.12),
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    pointer-events: all;
    transform: translateX(120%);
    opacity: 0;
    animation: toastSlideIn 0.5s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    overflow: hidden;
}

.custom-toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}

.custom-toast.toast-success::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.custom-toast.toast-error::before {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.custom-toast.toast-warning::before {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 100%);
}

.custom-toast.toast-info::before {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.custom-toast.hiding {
    animation: toastSlideOut 0.4s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

/* Toast Icon */
.toast-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.toast-success .toast-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.toast-error .toast-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.toast-warning .toast-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.toast-info .toast-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

/* Toast Content */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.3;
}

.toast-message {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Toast Close Button */
.toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #475569;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 16px 16px;
    overflow: hidden;
    width: 100%;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
}

.toast-success .toast-progress-bar {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.toast-error .toast-progress-bar {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.toast-warning .toast-progress-bar {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.toast-info .toast-progress-bar {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

/* Animations */
@keyframes toastSlideIn {
    0% {
        transform: translateX(120%);
        opacity: 0;
    }

    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

@keyframes progressShrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .custom-toast {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow:
            0 10px 40px rgba(0, 0, 0, 0.4),
            0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .toast-title {
        color: #f1f5f9;
    }

    .toast-message {
        color: #94a3b8;
    }

    .toast-close {
        color: #64748b;
    }

    .toast-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #94a3b8;
    }
}

/* =============================================
   MODERN CONFIRM DIALOG
   ============================================= */

.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    animation: confirmFadeIn 0.3s ease forwards;
}

.confirm-overlay.hiding {
    animation: confirmFadeOut 0.25s ease forwards;
}

.confirm-dialog {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 28px;
    max-width: 400px;
    width: 90%;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.25),
        0 10px 20px rgba(0, 0, 0, 0.15);
    transform: scale(0.9) translateY(20px);
    opacity: 1;
    animation: confirmSlideIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

.confirm-overlay.hiding .confirm-dialog {
    animation: confirmSlideOut 0.25s ease forwards;
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
}

.confirm-icon.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #d97706;
}

.confirm-icon.danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.confirm-icon.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.confirm-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.confirm-message {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
}

.confirm-btn-cancel {
    background: #f1f5f9;
    color: #475569;
}

.confirm-btn-cancel:hover {
    background: #e2e8f0;
}

.confirm-btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.confirm-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

.confirm-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.confirm-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

@keyframes confirmFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes confirmFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes confirmSlideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes confirmSlideOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }

    to {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
}

/* Dark Mode for Confirm Dialog */
@media (prefers-color-scheme: dark) {
    .confirm-dialog {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    }

    .confirm-title {
        color: #f1f5f9;
    }

    .confirm-message {
        color: #94a3b8;
    }

    .confirm-btn-cancel {
        background: #334155;
        color: #e2e8f0;
    }

    .confirm-btn-cancel:hover {
        background: #475569;
    }
}

/* Confirm Input */
.confirm-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.confirm-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #ffffff;
}

@media (prefers-color-scheme: dark) {
    .confirm-input {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }

    .confirm-input:focus {
        border-color: #60a5fa;
        background: #1e293b;
    }
}