/* Password Reset Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    /* Increased z-index */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    /* Explicit white */
    margin: auto;
    padding: 2.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    color: #333;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 1.5rem;
        margin-top: 10%;
        /* Ensure top margin on mobile */
    }

    .close-modal,
    .close-test-modal,
    .close-passcode-modal {
        top: 10px;
        right: 15px;
    }
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.modal-content .form-group {
    margin-bottom: 20px;
}

.modal-content .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #444;
}

.modal-content .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    /* Ensure padding doesn't affect width */
}

.modal-content .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 6px;
    margin-top: 10px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-modal,
.close-test-modal,
.close-passcode-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-modal:hover,
.close-test-modal:hover,
.close-passcode-modal:hover {
    color: #333;
}

/* Test Send Modal Specifics */
.modal-test-header {
    border-bottom: 2px solid var(--accent-color) !important;
    color: var(--accent-color) !important;
    margin-bottom: 15px;
    padding-bottom: 10px;
}

.modal-actions {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.static-info {
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

/* Passcode Modal Specifics */
.passcode-modal-content {
    max-width: 320px;
    text-align: center;
}

.passcode-inputs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.pass-digit {
    width: 45px;
    height: 55px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.pass-digit:focus {
    border-color: var(--accent-color);
    outline: none;
    background: #fff;
}

.input-passcode-field {
    width: 100px;
    letter-spacing: 5px;
    text-align: center;
}

/* Test Modal Channel Options */
.test-channel-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    cursor: pointer;
    transition: background-color 0.2s;
}

.test-channel-option:hover {
    background-color: #f0f0f0;
}

.test-channel-option label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.test-dest-info {
    font-size: 0.85rem;
}

@media (max-height: 500px) {
    .modal {
        align-items: flex-start;
        padding: 20px 0;
    }

    .modal-content {
        margin-top: 20px;
        margin-bottom: 20px;
        max-height: none;
    }
}