/**
 * Centralized Modal System for Orbit Theme
 * Handles all modal functionality including login, member profiles, etc.
 *
 * @package      Orbit
 * @author       Nebula
 * @since        1.0.0
 * @license      GPL-2.0+
 */

/* ==========================================================================
   Base Modal Styles
   ========================================================================== */

   .orbit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}

.orbit-modal.show {
    display: flex;
}

.orbit-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
    padding: 0;
    margin: auto;
    display: flex;
    flex-direction: column;
    top: 10%;
}

#login-modal .orbit-modal {}

/* Modal Sizes */
.orbit-modal-small .orbit-modal-content {max-width: 600px;}

.orbit-modal-medium .orbit-modal-content {
    width: 600px;
}

.orbit-modal-large .orbit-modal-content {
    width: 800px;
}

.orbit-modal-full .orbit-modal-content {
    width: 95%;
    height: 95%;
}

/* Modal Header */
.orbit-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.orbit-modal-title {
    margin: 0;
    font-size: var(--wp--preset--font-size--large);
}

.orbit-modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    border-radius: 50%;
}

.orbit-modal-close:hover {
    color: #333;
    background: #e9ecef;
}

.orbit-modal-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.3);
}

/* Modal Body */
.orbit-modal-body {
    padding: var(--wp--preset--spacing--medium);
    overflow-y: auto;
    flex: 1;
}

.orbit-modal-message {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.5;
}

/* Modal Footer */
.orbit-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* ==========================================================================
   Login Modal Specific Styles
   ========================================================================== */

.modal-login-form {
    margin-bottom: 20px;
}

.modal-login-form .form-group {
    margin-bottom: 20px;
}

.modal-login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.modal-login-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.modal-login-form .form-control:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.modal-login-form .form-actions {
    margin-top: 25px;
}

.modal-login-form .form-actions .button {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* WordPress Login Form Styles in Modal */
#modal-login-form {
    margin-bottom: 20px;
}

#modal-login-form .login-username,
#modal-login-form .login-password {
    margin-bottom: 20px;
}

#modal-login-form .login-username label,
#modal-login-form .login-password label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

#modal-login-form .input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#modal-login-form .input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

#modal-login-form .login-remember {
    margin: 15px 0;
}

#modal-login-form .login-remember label {
    display: flex;
    align-items: center;
    font-weight: normal;
    color: #666;
}

#modal-login-form .login-remember input[type="checkbox"] {
    margin-right: 8px;
}

#modal-login-form .login-submit {
    margin-top: 25px;
}

#modal-login-form .button-primary {
    /* width: 100%; */
    /* font-size: 16px; */
    /* font-weight: 600; */
    /* border-radius: 6px; */
    /* cursor: pointer; */
    /* transition: all 0.3s ease; */
    /* background: #007cba; */
    /* color: white; */
}

#modal-login-form .button-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

#login-error-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
}

#login-error-message p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.modal-options {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.option-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-links .button {
}

.option-links .button-secondary:hover {
}

.option-links .button-outline {
    /* background: transparent; */
    /* color: #007cba; */
    /* border: 2px solid #007cba; */
}

.option-links .button-outline:hover {
    background: #007cba;
    color: white;
    transform: translateY(-1px);
    border: 2px solid #000;
}

/* ==========================================================================
   Member Profile Modal Styles
   ========================================================================== */

.member-modal .orbit-modal-content {
    max-width: 800px;
    width: 90%;
}

.member-media {
    margin-bottom: 20px;
}

.member-banner {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 20px;
}

.member-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-logo {
    text-align: center;
    margin-bottom: 20px;
}

.member-logo img {
    max-height: 80px;
    max-width: 200px;
}

.member-biography h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.member-contact {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.contact-icon {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.contact-icon:hover {
    transform: scale(1.1);
}

.member-social {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

/* ==========================================================================
   Animation Classes
   ========================================================================== */

.orbit-modal-fade-in {
    animation: orbitFadeIn 0.3s ease forwards;
}

.orbit-modal-fade-out {
    animation: orbitFadeOut 0.3s ease forwards;
}

.orbit-modal-slide-in {
    animation: orbitSlideIn 0.3s ease forwards;
}

.orbit-modal-slide-out {
    animation: orbitSlideOut 0.3s ease forwards;
}

.orbit-modal-zoom-in {
    animation: orbitZoomIn 0.3s ease forwards;
}

.orbit-modal-zoom-out {
    animation: orbitZoomOut 0.3s ease forwards;
}

@keyframes orbitFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes orbitFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

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

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

@keyframes orbitZoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes orbitZoomOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.5);
    }
}

/* ==========================================================================
   Body State
   ========================================================================== */

body.orbit-modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .orbit-modal-content {
    }
    
    .orbit-modal-small,
    .orbit-modal-medium,
    .orbit-modal-large {
    }
    
    .orbit-modal-header {
        padding: 20px;
    }
    
    .orbit-modal-body {
        padding: 20px;
        max-height: 70vh;
    }
    
    .orbit-modal-footer {
        padding: 15px 20px;
    }
    
    .option-links {
        gap: 10px;
    }
    
    .option-links .button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .member-contact,
    .member-social {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .orbit-modal-content {
        max-width: 98%;
        max-height: 98%;
        margin: 5px;
    }
    
    .orbit-modal-header {
        padding: 15px;
    }
    
    .orbit-modal-body {
        padding: 15px;
    }
    
    .orbit-modal-footer {
        padding: 15px;
    }
    
    .modal-login-form .form-control {
        padding: 10px 14px;
        font-size: 14px;
    }
    
    .member-banner {
        height: 150px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .orbit-modal {
        display: none !important;
    }
    
    body.orbit-modal-open {
        overflow: auto !important;
    }
}
