/**
 * NativeModal CSS - Stili per sistema modal nativo
 * Compatibile con design esistente Bootstrap
 * @version 1.0.0
 */

/* ============================================
   Overlay Backdrop
   ============================================ */
.nm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ============================================
   Modal Container
   ============================================ */
.nm-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
    padding: 24px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

/* ============================================
   Header
   ============================================ */
.nm-header {
    margin-bottom: 16px;
}

.nm-icon {
    text-align: center;
    margin-bottom: 12px;
    line-height: 1;
}

.nm-title {
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 18pt;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
}

/* ============================================
   Body
   ============================================ */
.nm-body {
    margin-bottom: 20px;
    text-align: center;
    color: #555;
    line-height: 1.5;
}

.nm-body a {
    color: #007bff;
    text-decoration: underline;
}

.nm-body a:hover {
    color: #0056b3;
}

.nm-body strong,
.nm-body b {
    font-weight: 600;
}

/* ============================================
   Footer con Buttons
   ============================================ */
.nm-footer {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.nm-btn {
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    min-width: 100px;
}

.nm-btn:focus {
    outline: 2px solid #80bdff;
    outline-offset: 2px;
}

.nm-btn-confirm {
    background: #007bff;
    color: #fff;
}

.nm-btn-confirm:hover {
    background: #0056b3;
}

.nm-btn-confirm:active {
    background: #004085;
}

.nm-btn-cancel {
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
}

.nm-btn-cancel:hover {
    background: #f8f9fa;
    border-color: #999;
}

.nm-btn-cancel:active {
    background: #e9ecef;
}

/* ============================================
   Close Button
   ============================================ */
.nm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
    transition: color 0.2s ease;
}

.nm-close:hover {
    color: #333;
}

.nm-close:focus {
    outline: 2px solid #80bdff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Responsive - Mobile
   ============================================ */
@media (max-width: 768px) {
    .nm-modal {
        max-width: 92%;
        width: 92%;
        padding: 20px;
        margin: 16px;
    }

    .nm-icon {
        margin-bottom: 10px;
    }

    .nm-title {
        font-size: 16pt;
    }

    .nm-body {
        margin-bottom: 18px;
    }

    .nm-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .nm-btn {
        width: 100%;
        min-width: 0;
        padding: 12px 20px;
    }

    .nm-close {
        top: 10px;
        right: 10px;
    }
}

/* ============================================
   Responsive - Tablet
   ============================================ */
@media (min-width: 769px) and (max-width: 1024px) {
    .nm-modal {
        max-width: 480px;
    }
}

/* ============================================
   Animazioni (già gestite via inline transition)
   ============================================ */

/* ============================================
   Dark Mode Support (opzionale)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Se in futuro serve dark mode, aggiungere qui */
}

/* ============================================
   Print Support
   ============================================ */
@media print {
    .nm-overlay,
    .nm-modal {
        display: none !important;
    }
}
