/**
 * Warning Modal Component Styles
 * Replaces native browser alert(), confirm(), and prompt() dialogs
 * Provides consistent styling for warnings, confirmations, alerts, and prompts
 */

/* ============================
   MODAL OVERLAY
   ============================ */

.warning-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: overlayFadeIn 0.2s ease-out;
}

.warning-modal-overlay.show {
    display: flex;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================
   MODAL CONTAINER
   ============================ */

.warning-modal-container {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ============================
   MODAL CONTENT
   ============================ */

.warning-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    text-align: center;
    min-width: 380px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

/* ============================
   ICON STYLES
   ============================ */

.warning-modal-icon-container {
    width: 64px;
    height: 64px;
    position: relative;
}

.warning-modal-icon {
    width: 64px;
    height: 64px;
    stroke-width: 2;
    stroke-miterlimit: 10;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

/* Show only active icon */
.warning-modal-overlay[data-type="warning"] .warning-icon,
.warning-modal-overlay[data-type="danger"] .danger-icon,
.warning-modal-overlay[data-type="info"] .info-icon,
.warning-modal-overlay[data-type="confirm"] .confirm-icon,
.warning-modal-overlay[data-type="prompt"] .confirm-icon {
    display: block;
}

/* Warning Icon (Yellow) */
.warning-icon-circle {
    stroke: #f59e0b;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: iconStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.warning-icon-exclamation {
    stroke: #f59e0b;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 16;
    stroke-dashoffset: 16;
    animation: iconStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

/* Danger Icon (Red) */
.danger-icon-circle {
    stroke: #ef4444;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: iconStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.danger-icon-x {
    stroke: #ef4444;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 32;
    stroke-dashoffset: 32;
    animation: iconStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

/* Info Icon (Blue) */
.info-icon-circle {
    stroke: #3b82f6;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: iconStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.info-icon-i {
    stroke: #3b82f6;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 16;
    stroke-dashoffset: 16;
    animation: iconStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

/* Confirm Icon (Purple) */
.confirm-icon-circle {
    stroke: #4caf50;
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: iconStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.confirm-icon-question {
    stroke: #4caf50;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 32;
    stroke-dashoffset: 32;
    animation: iconStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

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

/* ============================
   TEXT CONTENT
   ============================ */

.warning-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
}

.warning-modal-message {
    margin: 0;
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.6;
    max-width: 400px;
}

/* ============================
   INPUT FIELD (for prompt type)
   ============================ */

.warning-modal-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
    outline: none;
}

.warning-modal-input:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.warning-modal-input::placeholder {
    color: #9ca3af;
}

/* ============================
   ACTION BUTTONS
   ============================ */

.warning-modal-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
}

.warning-modal-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.warning-modal-btn:active {
    transform: scale(0.98);
}

/* Cancel Button */
.warning-modal-btn-cancel {
    background: #f3f4f6;
    color: #6b7280;
}

.warning-modal-btn-cancel:hover {
    background: #e5e7eb;
    color: #4b5563;
}

/* Confirm Button - Default (Info/Warning) */
.warning-modal-btn-confirm {
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    color: white;
}

.warning-modal-btn-confirm:hover {
    filter: brightness(1.05);
}

.warning-modal-btn-confirm:active {
    filter: brightness(0.95);
}

/* Confirm Button - Danger Variant */
.warning-modal-overlay[data-type="danger"] .warning-modal-btn-confirm {
    background: linear-gradient(180deg, #f87171, #ef4444);
}

/* Confirm Button - Warning Variant */
.warning-modal-overlay[data-type="warning"] .warning-modal-btn-confirm {
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

/* Confirm Button - Confirm/Prompt Variant */
.warning-modal-overlay[data-type="confirm"] .warning-modal-btn-confirm,
.warning-modal-overlay[data-type="prompt"] .warning-modal-btn-confirm {
    background: linear-gradient(180deg, #4caf50, #4caf50);
}

/* Single button mode (no cancel button) */
.warning-modal-actions.single-button .warning-modal-btn-confirm {
    flex: 1;
}

.warning-modal-actions.single-button .warning-modal-btn-cancel {
    display: none;
}

/* ============================
   CLOSING ANIMATION
   ============================ */

.warning-modal-overlay.closing {
    animation: overlayFadeOut 0.2s ease-in forwards;
}

.warning-modal-overlay.closing .warning-modal-container {
    animation: modalSlideOut 0.2s ease-in forwards;
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

/* ============================
   RESPONSIVE DESIGN
   ============================ */

@media (max-width: 520px) {
    .warning-modal-content {
        min-width: unset;
        width: 90vw;
        padding: 1.5rem;
    }

    .warning-modal-title {
        font-size: 1.25rem;
    }

    .warning-modal-message {
        font-size: 0.9375rem;
    }

    .warning-modal-icon {
        width: 56px;
        height: 56px;
    }

    .warning-modal-icon-container {
        width: 56px;
        height: 56px;
    }

    .warning-modal-actions {
        flex-direction: column-reverse;
    }

    .warning-modal-btn {
        width: 100%;
    }
}

/* ============================
   ACCESSIBILITY
   ============================ */
/* OBROBA OKOLI GUMBA */
/* .warning-modal-btn:focus-visible {
    outline: 2px solid #4caf50;
    outline-offset: 2px;
} */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .warning-modal-overlay,
    .warning-modal-container,
    .warning-modal-icon-circle,
    .warning-modal-icon-exclamation,
    .warning-modal-icon-x,
    .warning-modal-icon-i,
    .warning-modal-icon-question {
        animation: none;
    }

    .warning-modal-btn {
        transition: none;
    }
}
