/**
 * Custom Login Page Styles
 * 
 * @package YOOPixel Management
 * @since 2.2.0
 */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');


/* Force responsive behavior */
html {
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
}

/* Login Page Styles */
body.yoopxl-login-page {
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: url('../images/background.png') center center no-repeat !important;
    background-size: cover !important;
    background-attachment: fixed !important;
    overflow-x: hidden !important;
    overflow-y: auto !important; /* السماح بالتمرير العمودي */
    -webkit-overflow-scrolling: touch !important; /* تحسين التمرير على iOS */
}


/* Hide header and footer on login page */
body.yoopxl-login-page header,
body.yoopxl-login-page .site-header,
body.yoopxl-login-page .fusion-header,
body.yoopxl-login-page .avada-header,
body.yoopxl-login-page #header,
body.yoopxl-login-page .header,
body.yoopxl-login-page footer,
body.yoopxl-login-page .site-footer,
body.yoopxl-login-page .fusion-footer,
body.yoopxl-login-page .avada-footer,
body.yoopxl-login-page #footer,
body.yoopxl-login-page .footer,
body.yoopxl-login-page #main,
body.yoopxl-login-page .site-content,
body.yoopxl-login-page .fusion-main,
body.yoopxl-login-page .avada-page-content,
body.yoopxl-login-page #content,
body.yoopxl-login-page .content {
    display: none !important;
    visibility: hidden !important;
}

.yoopxl-login-page {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    z-index: 99999 !important;
    overflow-y: auto !important;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    animation: fadeIn 0.3s ease !important;
    margin: 0 !important;
    max-width: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Wrapper */
.yoopxl-login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f7fafc;
    z-index: 99999;
    overflow-y: auto;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.yoopxl-login-wrapper * {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.yoopxl-login-container {
    display: flex !important;
    max-width: 1100px !important;
    width: 100% !important;
    background: #fff !important;
    border-radius: 16px !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden !important;
    min-height: 600px !important;
    max-height: 90vh !important;
    animation: slideUp 0.4s ease !important;
    position: relative !important;
    flex-wrap: nowrap !important;
    margin: 0 !important;
    height: auto !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Left Side - Image */
.yoopxl-login-image {
    flex: 1;
    background: #f8f9fa url('../images/background.jpg') left center no-repeat;
    background-size: cover;
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .yoopxl-login-image {
        display: block;
    }
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.overlay-content {
    text-align: center;
    color: #fff;
    position: relative;
    z-index: 1;
    background: rgba(0, 0, 0, 0.15);
    padding: 40px 30px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.overlay-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.overlay-content p {
    font-size: 16px;
    line-height: 1.6;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Right Side - Form */
.yoopxl-login-form-section {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
    min-width: 0;
}

@media (max-width: 767px) {
    .yoopxl-login-form-section {
        padding: 40px 30px;
    }
}

/* Close Modal Button */
.yoopxl-close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #718096;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.yoopxl-close-modal:hover {
    color: #fff;
    background: #EEB44E;
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(238, 180, 78, 0.3);
}

.yoopxl-close-modal .dashicons {
    font-family: dashicons !important;
    font-size: 22px;
    width: 22px;
    height: 22px;
}

/* Logo */
.yoopxl-login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.yoopxl-login-logo a {
    display: inline-block;
    transition: opacity 0.2s;
}

.yoopxl-login-logo a:hover {
    opacity: 0.8;
}

.yoopxl-login-logo img {
    max-width: 220px;
    height: auto;
}

/* Form Container */
.form-container {
    display: none;
}

.form-container.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-container h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 14px;
    color: #718096;
    margin-bottom: 30px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #EEB44E;
    box-shadow: 0 0 0 3px rgba(238, 180, 78, 0.1);
}

/* Form Row */
.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
}

.link-btn {
    font-size: 14px;
    color: #EEB44E;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    background: none !important;
    border: none !important;
    padding: 0;
    cursor: pointer;
}

.link-btn:hover {
    color: #d89b3a;
    background: none !important;
    border: none !important;
}

.link-btn:focus,
.link-btn:active {
    background: none !important;
    border: none !important;
    outline: none;
    box-shadow: none;
}

.link-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

/* Message Box - Fixed position, doesn't affect page layout */
.message-box {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: calc(100% - 40px);
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    z-index: 100002;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideDownMessage 0.3s ease-out;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@keyframes slideDownMessage {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.message-box.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

.message-box.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
}

.message-box.info {
    background: #bee3f8;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: #EEB44E;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.submit-btn:hover {
    background: #d89b3a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 180, 78, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-block;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Footer */
.form-footer {
    margin-top: 24px;
    text-align: center;
}

.form-footer p {
    font-size: 14px;
    color: #718096;
    margin-bottom: 12px;
}

.form-footer a {
    color: #EEB44E;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    color: #d89b3a;
}

/* Responsive */
@media (max-width: 767px) {
    .yoopxl-login-container {
        min-height: auto;
    }
    
    .form-container h1 {
        font-size: 24px;
    }
    
    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    /* تحسينات إضافية للموبايل */
    body.yoopxl-login-page {
        background-attachment: scroll !important; /* تحسين الأداء على الموبايل */
    }
    
    /* منع التكبير التلقائي في Safari */
    .form-input {
        font-size: 16px !important;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* تحسين الأزرار للمس */
    .form-button,
    .form-link {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .yoopxl-login-wrapper {
        padding: 10px 8px !important;
    }
    
    .yoopxl-login-container {
        margin: 5px 0 !important;
        border-radius: 8px !important;
    }
    
    .form-container {
        padding: 20px 15px !important;
    }
    
    .form-container h1 {
        font-size: 20px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .yoopxl-login-wrapper {
        padding: 8px 5px !important;
    }
    
    .form-container {
        padding: 15px 12px !important;
    }
    
    .form-container h1 {
        font-size: 18px;
    }
    
    .form-button {
        padding: 10px 16px;
        font-size: 14px;
    }
}
