/* Styles for the base modal */
.modal {
    z-index: 2000 !important;
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-bg) !important;
    color: var(--text) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 0.75rem !important;
    background-color: var(--card-bg);
    margin: auto;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow);
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

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

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--primary);
}

.modal h2 {
    text-align: center;
    color: var(--text);
    margin-bottom: 20px;
    font-size: 1.8em;
}

.modal .login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

#forgot-password-form {
    margin-top: 30px;
}

.modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal .form-group label {
    color: var(--text);
    font-weight: 500;
}

.modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background-color: var(--card-bg);
    transition: all 0.3s ease;
}

.modal .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.1);
}

.modal .login-button {
    width: 100%;
    cursor: pointer;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal .login-button:hover {
    background-color: var(--button-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--shadow);
}

.modal .login-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.modal-footer {
    border: none !important;
    padding: 0.75rem 0 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 0.5rem !important;
    text-align: center;
    margin-top: 20px;
    color: var(--text);
}

.modal-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.modal-footer a:hover {
    text-decoration: underline;
}

.error-message, .success-message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.error-message {
    color: #e53e3e;
    background-color: rgba(229, 62, 62, 0.1);
}

.success-message {
    color: #2f855a;
    background-color: rgba(47, 133, 90, 0.1);
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.image-modal.active {
    display: flex;
}

.image-modal-content {
    max-height: 90vh;
    max-width: 90vw;
    object-fit: contain;
}

.modal-loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 2002;
}

.close-button {
    position: fixed;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.nav-button {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Print Styles */
@media print {
    .modal-dialog {
        max-width: none;
        margin: 0;
    }

    .modal-content {
        border: none;
        box-shadow: none;
    }
}

/* Modal theme overrides */
.modal-content {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border-color);
}

.modal-header {
    border-color: var(--border-color);
}

.modal-footer {
    border-color: var(--border-color);
}

/* Unused custom control CSS removed - now using simple radio buttons */