/**
 * TBP Portal Confirmation Dialog
 * Reusable confirmation modal with micro-animations
 */

/* Overlay */
.tbp-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.tbp-confirm-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Dialog Box */
.tbp-confirm-dialog {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

.tbp-confirm-overlay.is-active .tbp-confirm-dialog {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Dialog Header */
.tbp-confirm-header {
    padding: 24px 24px 0;
    text-align: center;
}

.tbp-confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: tbp-confirm-icon-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes tbp-confirm-icon-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tbp-confirm-icon .ti {
    font-size: 32px;
    line-height: 1;
}

/* Icon Variants */
.tbp-confirm-icon--warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.tbp-confirm-icon--danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tbp-confirm-icon--info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tbp-confirm-icon--success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

/* Dialog Content */
.tbp-confirm-content {
    padding: 0 24px 24px;
    text-align: center;
}

.tbp-confirm-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--tbp-text, #011A29);
    animation: tbp-confirm-fade-up 0.3s ease 0.15s both;
}

.tbp-confirm-message {
    margin: 0;
    font-size: 15px;
    color: #64748b;
    line-height: 1.5;
    animation: tbp-confirm-fade-up 0.3s ease 0.2s both;
}

@keyframes tbp-confirm-fade-up {
    0% {
        transform: translateY(10px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Type to Confirm Input */
.tbp-confirm-input-wrapper {
    margin-top: 20px;
    animation: tbp-confirm-fade-up 0.3s ease 0.25s both;
}

.tbp-confirm-input-label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.tbp-confirm-input-label code {
    background: #fee2e2;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
}

.tbp-confirm-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    text-align: center;
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 1px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.tbp-confirm-input:focus {
    outline: none;
    border-color: var(--tbp-accent-2, #5CD4D6);
    box-shadow: 0 0 0 3px rgba(92, 212, 214, 0.15);
}

.tbp-confirm-input.is-valid {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.tbp-confirm-input.is-invalid {
    border-color: #ef4444;
    animation: tbp-confirm-shake 0.4s ease;
}

@keyframes tbp-confirm-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* Dialog Footer */
.tbp-confirm-footer {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
    animation: tbp-confirm-fade-up 0.3s ease 0.3s both;
}

.tbp-confirm-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tbp-confirm-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}

.tbp-confirm-btn:active:not(:disabled) {
    transform: translateY(0);
}

.tbp-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Variants */
.tbp-confirm-btn--cancel {
    background: #f1f5f9;
    color: #475569;
}

.tbp-confirm-btn--cancel:hover:not(:disabled) {
    background: #e2e8f0;
}

.tbp-confirm-btn--confirm {
    background: var(--tbp-accent-2, #5CD4D6);
    color: #fff;
}

.tbp-confirm-btn--confirm:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(92, 212, 214, 0.4);
}

.tbp-confirm-btn--danger {
    background: #ef4444;
    color: #fff;
}

.tbp-confirm-btn--danger:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.tbp-confirm-btn--warning {
    background: #f59e0b;
    color: #fff;
}

.tbp-confirm-btn--warning:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Loading State */
.tbp-confirm-btn .tbp-confirm-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tbp-confirm-spin 0.6s linear infinite;
    display: none;
}

.tbp-confirm-btn.is-loading .tbp-confirm-spinner {
    display: block;
}

.tbp-confirm-btn.is-loading .tbp-confirm-btn-text {
    display: none;
}

@keyframes tbp-confirm-spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .tbp-confirm-dialog {
        max-width: 100%;
        margin: 0 16px;
    }

    .tbp-confirm-footer {
        flex-direction: column-reverse;
    }
}
