/**
 * 땅튜브 토스트 알림 스타일
 *
 * @package DdangTube
 * @version 1.0.0
 */

/* ========== Toast Container ========== */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 320px;
    max-width: 500px;
    pointer-events: none;
}

/* ========== Toast Item ========== */
.toast {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    animation: slideDown 0.3s ease;
    transition: all var(--transition-normal);
}

.toast.hiding {
    animation: slideUp 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* ========== Toast Icon ========== */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
}

/* ========== Toast Content ========== */
.toast-content {
    flex: 1;
}

.toast-message {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

/* ========== Toast Close Button ========== */
.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    padding: 0;
    background: none;
}

.toast-close:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

/* ========== Toast Types ========== */

/* Success (성공) */
.toast.toast-success {
    border-left: 4px solid var(--accent-success);
}

.toast.toast-success .toast-icon {
    color: var(--accent-success);
}

/* Error (오류) */
.toast.toast-error {
    border-left: 4px solid var(--accent-danger);
}

.toast.toast-error .toast-icon {
    color: var(--accent-danger);
}

/* Warning (경고) */
.toast.toast-warning {
    border-left: 4px solid var(--accent-warning);
}

.toast.toast-warning .toast-icon {
    color: var(--accent-warning);
}

/* Info (정보) */
.toast.toast-info {
    border-left: 4px solid var(--accent-info);
}

.toast.toast-info .toast-icon {
    color: var(--accent-info);
}

/* ========== Progress Bar ========== */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--border-primary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background-color: currentColor;
    animation: progress 3s linear;
}

.toast.toast-success .toast-progress-bar {
    background-color: var(--accent-success);
}

.toast.toast-error .toast-progress-bar {
    background-color: var(--accent-danger);
}

.toast.toast-warning .toast-progress-bar {
    background-color: var(--accent-warning);
}

.toast.toast-info .toast-progress-bar {
    background-color: var(--accent-info);
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .toast-container {
        min-width: auto;
        left: 1rem;
        right: 1rem;
        transform: none;
    }

    .toast {
        padding: 0.875rem 1rem;
    }

    .toast-message {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .toast-container {
        top: 70px;
    }

    .toast {
        padding: 0.75rem 0.875rem;
    }

    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 1rem;
    }

    .toast-message {
        font-size: 0.85rem;
    }
}
