/* UI 알림 시스템 - 모달/토스트 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Toast */
.toast {
    min-width: 300px;
    padding: 16px 20px;
    background: #fff;
    border-left: 4px solid #007bff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success {
    border-left-color: #28a745;
}

.toast.error {
    border-left-color: #dc3545;
}

.toast.warning {
    border-left-color: #ffc107;
}

.toast.info {
    border-left-color: #17a2b8;
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
}

.toast-close:hover {
    color: #333;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease-out forwards;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay.removing {
    animation: fadeOut 0.2s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Modal Box */
.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.2s ease-out;
}

.modal-overlay.removing .modal-box {
    animation: scaleOut 0.2s ease-out forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes scaleOut {
    from {
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    margin-bottom: 20px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-button.primary {
    background: #007bff;
    color: #fff;
}

.modal-button.primary:hover {
    background: #0056b3;
}

.modal-button.secondary {
    background: #6c757d;
    color: #fff;
}

.modal-button.secondary:hover {
    background: #545b62;
}

.modal-button.danger {
    background: #dc3545;
    color: #fff;
}

.modal-button.danger:hover {
    background: #c82333;
}

/* ================================================================
   DARK MODE OVERRIDES - Toast & Modal
   ================================================================ */
[data-theme="dark"] .toast {
    background: #1e293b;
    border-left-color: #60a5fa;
    box-shadow: 0 4px 12px rgba(0,0,0,.5);
}
[data-theme="dark"] .toast.success { border-left-color: #34d399; }
[data-theme="dark"] .toast.error { border-left-color: #f87171; }
[data-theme="dark"] .toast.warning { border-left-color: #fcd34d; }
[data-theme="dark"] .toast.info { border-left-color: #60a5fa; }

[data-theme="dark"] .toast-message {
    color: #e2e8f0;
}
[data-theme="dark"] .toast-close {
    color: #6b7280;
}
[data-theme="dark"] .toast-close:hover {
    color: #9ca3af;
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0,0,0,.7);
}
[data-theme="dark"] .modal-box {
    background: #1e293b;
    box-shadow: 0 8px 32px rgba(0,0,0,.6);
    border: 1px solid #374151;
}
[data-theme="dark"] .modal-header {
    color: #f9fafb;
    border-bottom-color: #374151;
}
[data-theme="dark"] .modal-close {
    color: #6b7280;
}
[data-theme="dark"] .modal-close:hover {
    color: #9ca3af;
}
[data-theme="dark"] .modal-body {
    color: #9ca3af;
}
[data-theme="dark"] .modal-button {
    background: #374151;
    color: #e2e8f0;
}
[data-theme="dark"] .modal-button:hover {
    background: #4b5563;
}
