/* ==========================================================================
   UNITED SOFT TECH - UNIVERSAL APPLICATION POPUP STYLES
   Modern Glassmorphic Modal Dialog with Micro-animations
   ========================================================================== */

.app-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.app-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.60);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.app-popup-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 20px;
    padding: 32px 28px 24px 28px;
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.35),
                0 0 0 1px rgba(226, 232, 240, 0.9);
    text-align: center;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    box-sizing: border-box;
}

.app-popup-overlay.active .app-popup-card {
    transform: scale(1) translateY(0);
}

/* Close Button */
.app-popup-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.app-popup-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

/* Animated SVG Icon */
.app-popup-icon-wrapper {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-popup-icon-svg {
    width: 68px;
    height: 68px;
}

.app-popup-icon-circle {
    stroke-width: 2.5;
    stroke-miterlimit: 10;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: popupStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.app-popup-icon-circle.success { stroke: #10b981; }
.app-popup-icon-circle.error   { stroke: #ef4444; }
.app-popup-icon-circle.warning { stroke: #f59e0b; }
.app-popup-icon-circle.info    { stroke: #2563eb; }

.app-popup-icon-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3.5;
    stroke: #10b981;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: popupStroke 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

.app-popup-icon-cross {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3.5;
    stroke: #ef4444;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: popupStroke 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

.app-popup-icon-exclamation {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    stroke-width: 3.5;
    stroke: #f59e0b;
    stroke-linecap: round;
    animation: popupStroke 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

.app-popup-icon-info {
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    stroke-width: 3.5;
    stroke: #2563eb;
    stroke-linecap: round;
    stroke-linejoin: round;
    animation: popupStroke 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes popupStroke {
    100% { stroke-dashoffset: 0; }
}

/* Typography */
.app-popup-title {
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.type-success .app-popup-title { color: #047857; }
.type-error   .app-popup-title { color: #b91c1c; }
.type-warning .app-popup-title { color: #b45309; }
.type-info    .app-popup-title { color: #1d4ed8; }

.app-popup-body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    color: #475569;
    margin-bottom: 22px;
    word-break: break-word;
}

/* Action Button */
.app-popup-footer {
    display: flex;
    justify-content: center;
}

.app-popup-action-btn {
    min-width: 140px;
    padding: 10px 24px;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    outline: none;
}

.app-popup-action-btn:active {
    transform: scale(0.96);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}
.btn-error:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.45);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-warning:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
}

.btn-info {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-info:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

/* Auto-dismiss countdown track */
.app-popup-progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: #f1f5f9;
}

.app-popup-progress-fill {
    height: 100%;
    width: 0%;
}

.type-success .app-popup-progress-fill { background: #10b981; }
.type-error   .app-popup-progress-fill { background: #ef4444; }
.type-warning .app-popup-progress-fill { background: #f59e0b; }
.type-info    .app-popup-progress-fill { background: #2563eb; }

/* Mini Progress Bar Styles for Grid Views */
.progress-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    vertical-align: middle;
}

.progress-bar-track {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-pct-badge {
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pct-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.pct-bar-fill.done { background: linear-gradient(90deg, #10b981, #059669); }
.pct-bar-fill.high { background: linear-gradient(90deg, #06b6d4, #0284c7); }
.pct-bar-fill.mid  { background: linear-gradient(90deg, #f59e0b, #d97706); }
.pct-bar-fill.low  { background: linear-gradient(90deg, #64748b, #475569); }

/* ==========================================================================
   BRANDED PAGE & ACTION LOADING OVERLAY WITH LOGO ANIMATION
   ========================================================================== */
.app-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-page-loader.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.app-page-loader .loader-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.app-page-loader .loader-content-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 26px;
    padding: 34px 44px 28px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.4),
                0 0 0 1px rgba(226, 232, 240, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transform: scale(0.90) translateY(8px);
    transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 250px;
    text-align: center;
}

.app-page-loader.active .loader-content-card {
    transform: scale(1) translateY(0);
}

.loader-logo-container {
    position: relative;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-spinner-ring {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 3.5px solid #e2e8f0;
    border-top-color: #2563eb;
    border-right-color: #6366f1;
    animation: ustLoaderSpin 1.1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.loader-pulse-glow {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, rgba(99, 102, 241, 0) 70%);
    animation: ustLoaderPulse 1.8s ease-in-out infinite;
}

.loader-brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 4px 10px rgba(37, 99, 235, 0.25));
    animation: ustLoaderFloat 2s ease-in-out infinite;
}

.loader-text-wrapper {
    text-align: center;
}

.loader-brand-title {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
    letter-spacing: -0.2px;
}

.loader-status-msg {
    font-size: 13.5px;
    font-weight: 600;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.loader-dots span {
    display: inline-block;
    animation: ustLoaderDotBounce 1.4s infinite ease-in-out both;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    color: #2563eb;
}

.loader-dots span:nth-child(1) { animation-delay: -0.32s; }
.loader-dots span:nth-child(2) { animation-delay: -0.16s; }
.loader-dots span:nth-child(3) { animation-delay: 0s; }

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

@keyframes ustLoaderPulse {
    0%, 100% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.18); opacity: 0.95; }
}

@keyframes ustLoaderFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes ustLoaderDotBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
    40% { transform: scale(1); opacity: 1; }
}
