/**
 * Universal Alert Modal - Styles
 * Beautiful, modern, and responsive alert modal
 */

.ua-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ua-modal.ua-show {
    display: flex;
    opacity: 1;
}

/* Overlay */
.ua-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal Container */
.ua-container {
    position: relative;
    background: white;
    border-radius: 20px;
    padding: 40px 30px 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: ua-slideIn 0.3s ease;
    z-index: 1;
}

@keyframes ua-slideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Icon */
.ua-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: ua-iconPop 0.5s ease;
}

@keyframes ua-iconPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.ua-icon.ua-success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.3);
}

.ua-icon.ua-error {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.ua-icon.ua-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

.ua-icon.ua-info {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

.ua-icon i {
    animation: ua-iconRotate 0.5s ease;
}

@keyframes ua-iconRotate {
    from {
        transform: rotate(-180deg);
    }

    to {
        transform: rotate(0deg);
    }
}

/* Title */
.ua-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 15px;
}

/* Message */
.ua-message {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 30px;
    overflow-x: auto;
    /* Handlze horizontal overflow for tables */
    max-height: 60vh;
    /* Handle vertical overflow on small screens */
    overflow-y: auto;
    width: 100%;
    /* Ensure it takes full width */
}

/* Buttons */
.ua-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.ua-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.ua-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.ua-btn:active {
    transform: translateY(0);
}

.ua-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ua-btn-primary:hover {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.ua-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.ua-btn-secondary:hover {
    background: #d1d5db;
}

/* Dark Mode Support */
body.dark-mode .ua-container {
    background: #1f2937;
}

body.dark-mode .ua-title {
    color: #f9fafb;
}

body.dark-mode .ua-message {
    color: #d1d5db;
}

body.dark-mode .ua-btn-secondary {
    background: #374151;
    color: #f9fafb;
}

body.dark-mode .ua-btn-secondary:hover {
    background: #4b5563;
}

/* Responsive */
@media (max-width: 600px) {
    .ua-container {
        padding: 20px 15px 15px;
        /* Reduced padding for more space */
        max-width: 95%;
        width: 95%;
    }

    .ua-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .ua-title {
        font-size: 20px;
    }

    .ua-message {
        font-size: 14px;
    }

    .ua-btn {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }

    .ua-buttons {
        gap: 10px;
    }
}

/* Dark Mode Support */
body.dark-mode .ua-container {
    background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%) !important;
    backdrop-filter: blur(15px) !important;
    border: 2px solid rgba(102, 126, 234, 0.4) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8) !important;
}

body.dark-mode .ua-title {
    color: #a5b4fc !important;
}

body.dark-mode .ua-message {
    color: #e2e8f0 !important;
}

body.dark-mode .ua-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4) !important;
}

body.dark-mode .ua-btn-secondary {
    background: rgba(71, 85, 105, 0.8) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #e2e8f0 !important;
}

body.dark-mode .ua-loading p {
    color: #a5b4fc !important;
}

/* Pencil Loader Animation */
.ua-loading {
    display: none;
    padding: 40px;
    text-align: center;
}

.ua-loading.ua-show {
    display: block;
}

.pencil {
    display: inline-block;
    width: 10em;
    height: 10em;
}

.pencil__body1,
.pencil__body2,
.pencil__body3,
.pencil__eraser,
.pencil__eraser-skew,
.pencil__point,
.pencil__rotate,
.pencil__stroke {
    animation-duration: 3s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.pencil__body1,
.pencil__body2,
.pencil__body3 {
    transform: rotate(-90deg);
}

.pencil__body1 {
    animation-name: pencilBody1;
}

.pencil__body2 {
    animation-name: pencilBody2;
}

.pencil__body3 {
    animation-name: pencilBody3;
}

.pencil__eraser {
    animation-name: pencilEraser;
    transform: rotate(-90deg) translate(49px, 0);
}

.pencil__eraser-skew {
    animation-name: pencilEraserSkew;
    animation-timing-function: ease-in-out;
}

.pencil__point {
    animation-name: pencilPoint;
    transform: rotate(-90deg) translate(49px, -30px);
}

.pencil__rotate {
    animation-name: pencilRotate;
}

.pencil__stroke {
    animation-name: pencilStroke;
    transform: translate(100px, 100px) rotate(-113deg);
}

/* Animations */
@keyframes pencilBody1 {

    from,
    to {
        stroke-dashoffset: 351.86;
        transform: rotate(-90deg);
    }

    50% {
        stroke-dashoffset: 150.8;
        transform: rotate(-225deg);
    }
}

@keyframes pencilBody2 {

    from,
    to {
        stroke-dashoffset: 406.84;
        transform: rotate(-90deg);
    }

    50% {
        stroke-dashoffset: 174.36;
        transform: rotate(-225deg);
    }
}

@keyframes pencilBody3 {

    from,
    to {
        stroke-dashoffset: 296.88;
        transform: rotate(-90deg);
    }

    50% {
        stroke-dashoffset: 127.23;
        transform: rotate(-225deg);
    }
}

@keyframes pencilEraser {

    from,
    to {
        transform: rotate(-45deg) translate(49px, 0);
    }

    50% {
        transform: rotate(0deg) translate(49px, 0);
    }
}

@keyframes pencilEraserSkew {

    from,
    32.5%,
    67.5%,
    to {
        transform: skewX(0);
    }

    35%,
    65% {
        transform: skewX(-4deg);
    }

    37.5%,
    62.5% {
        transform: skewX(8deg);
    }

    40%,
    45%,
    50%,
    55%,
    60% {
        transform: skewX(-15deg);
    }

    42.5%,
    47.5%,
    52.5%,
    57.5% {
        transform: skewX(15deg);
    }
}

@keyframes pencilPoint {

    from,
    to {
        transform: rotate(-90deg) translate(49px, -30px);
    }

    50% {
        transform: rotate(-225deg) translate(49px, -30px);
    }
}

@keyframes pencilRotate {
    from {
        transform: translate(100px, 100px) rotate(0);
    }

    to {
        transform: translate(100px, 100px) rotate(720deg);
    }
}

@keyframes pencilStroke {
    from {
        stroke-dashoffset: 439.82;
        transform: translate(100px, 100px) rotate(-113deg);
    }

    50% {
        stroke-dashoffset: 164.93;
        transform: translate(100px, 100px) rotate(-113deg);
    }

    75%,
    to {
        stroke-dashoffset: 439.82;
        transform: translate(100px, 100px) rotate(112deg);
    }
}