/* Enhanced popup centering styles */

.notice.notice-success {
    color: #07f773;
}
.notice.notice-error {
    color: #f70707;
}

.send-file-link-form {
    margin-top: 15px;
}

.send-file-link-form label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    color: #555;
}

.send-file-link-form input {
    width: -webkit-fill-available;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.send-file-link-form .lm-magnet-genius-send {
    background-color: #030783;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.lm-popup-button{
    text-align: right;
}

.send-file-link-form .lm-magnet-genius-send:hover {
    background-color: #0309ad;
}

.lm-spinner {
    width: 10px;
    height: 10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
    vertical-align: middle;
    margin-right: 5px;
}

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

.lm-spinner.show {
    display: inline-block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Enhanced popup centering - Perfect middle positioning */
.lm-popup {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.lm-popup-content {
    background-color: #fff;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 6px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: scale(1);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

/* Animation when popup appears */
.lm-popup[style*="display: block"] .lm-popup-content {
    animation: popupAppear 0.3s ease-out forwards;
}

@keyframes popupAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lm-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
    line-height: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.lm-close:hover {
    color: #000;
    background-color: #f0f0f0;
}

.lm-success {
    color: #19ae5c;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background-color: #f0f8f0;
    border: 1px solid #d4edda;
    border-radius: 4px;
}

.lm-error {
    color: #f00;
    font-size: 14px;
    margin-top: 10px;
    padding: 10px;
    background-color: #fdf2f2;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .lm-popup {
        padding: 10px;
    }

    .lm-popup-content {
        padding: 15px;
        max-width: none;
        margin: 0;
    }

    .send-file-link-form input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Ensure popup stays centered even with different content heights */
@media (max-height: 600px) {
    .lm-popup-content {
        max-height: 80vh;
    }
}
