/* ===================================
   Toast Notifications
   =================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 320px;
    max-width: 420px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: all;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(400px) scale(0.8);
}

.toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success .toast-icon {
    background: #D1FAE5;
    color: #10B981;
}

.toast-error .toast-icon {
    background: #FEE2E2;
    color: #EF4444;
}

.toast-warning .toast-icon {
    background: #FEF3C7;
    color: #F59E0B;
}

.toast-info .toast-icon {
    background: #DBEAFE;
    color: #3B82F6;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    font-size: 14px;
    color: #0F172A;
    font-weight: 500;
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #94A3B8;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.toast-close:hover {
    background: #F1F5F9;
    color: #64748B;
}

/* ===================================
   Confirmation Modal
   =================================== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.confirm-overlay.show {
    opacity: 1;
    visibility: visible;
}

.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.confirm-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.confirm-modal-content {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 32px;
    min-width: 400px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.confirm-modal-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 12px;
}

.confirm-modal-message {
    font-size: 15px;
    color: #64748B;
    line-height: 1.6;
    margin-bottom: 28px;
}

.confirm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-confirm-cancel,
.btn-confirm-ok {
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-confirm-cancel {
    background: #F1F5F9;
    color: #64748B;
}

.btn-confirm-cancel:hover {
    background: #E2E8F0;
}

.btn-confirm-ok {
    background: #3B82F6;
    color: #FFFFFF;
}

.btn-confirm-ok:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ===================================
   Progress Bar (Top)
   =================================== */
.progress-bar-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

.progress-bar-top.active {
    opacity: 1;
    visibility: visible;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%);
    width: 0%;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* ===================================
   Loading Overlay
   =================================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.loading-spinner {
    text-align: center;
}

.spinner-ring {
    display: inline-block;
    width: 60px;
    height: 60px;
    margin: 0 auto;
    position: relative;
}

.spinner-ring:nth-child(1),
.spinner-ring:nth-child(2),
.spinner-ring:nth-child(3) {
    position: absolute;
    border: 3px solid transparent;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.spinner-ring:nth-child(1) {
    width: 60px;
    height: 60px;
}

.spinner-ring:nth-child(2) {
    width: 45px;
    height: 45px;
    top: 7.5px;
    left: 7.5px;
    animation-delay: -0.5s;
    border-top-color: #60A5FA;
}

.spinner-ring:nth-child(3) {
    width: 30px;
    height: 30px;
    top: 15px;
    left: 15px;
    animation-delay: -1s;
    border-top-color: #93C5FD;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-text {
    color: #FFFFFF;
    font-size: 15px;
    margin-top: 80px;
    font-weight: 500;
}

/* ===================================
   Button Loading State
   =================================== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* ===================================
   Skeleton Loaders
   =================================== */
.skeleton {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 12px;
    width: 100%;
}

.skeleton-text:last-child {
    margin-bottom: 0;
}

.skeleton-title {
    height: 28px;
    width: 70%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-image {
    width: 100%;
    height: 200px;
    margin-bottom: 16px;
}

.skeleton-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.skeleton-loading {
    pointer-events: none;
}

/* ===================================
   Progress Bar (Inline)
   =================================== */
.progress-bar-inline {
    width: 100%;
    height: 8px;
    background: #F1F5F9;
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-bar-inline-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6 0%, #60A5FA 100%);
    border-radius: 100px;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-inline-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-label {
    font-size: 13px;
    color: #64748B;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-percentage {
    font-weight: 600;
    color: #3B82F6;
}

/* ===================================
   Feedback Animations
   =================================== */
.feedback-success {
    animation: feedback-bounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.feedback-error {
    animation: feedback-shake 0.5s;
}

@keyframes feedback-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes feedback-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===================================
   Tooltips
   =================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #0F172A;
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #0F172A;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

[data-tooltip]:hover:before,
[data-tooltip]:hover:after {
    opacity: 1;
    visibility: visible;
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 640px) {
    .toast-container {
        left: 20px;
        right: 20px;
        top: 20px;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
    
    .confirm-modal-content {
        min-width: auto;
        width: calc(100vw - 40px);
        padding: 24px;
    }
    
    .confirm-modal-actions {
        flex-direction: column;
    }
    
    .btn-confirm-cancel,
    .btn-confirm-ok {
        width: 100%;
    }
}
