/**
 * AdManager Login Popup Component Styles
 * @version 2.0.0
 * @author AdManager Team
 */

:root {
    --adm-primary-color: #3b82f6;
    --adm-primary-hover: #2563eb;
    --adm-success-color: #10b981;
    --adm-error-color: #ef4444;
    --adm-text-primary: #1f2937;
    --adm-text-secondary: #6b7280;
    --adm-border-color: #e5e7eb;
    --adm-radius: 12px;
    --adm-transition: all 0.3s ease;
    --adm-overlay-bg: rgba(0, 0, 0, 0.25); /* Lighter overlay to match Figma */
    --adm-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    --adm-font-family: "Inter", system-ui, -apple-system, sans-serif;
}

/* Main overlay with highest z-index */
.admanager-login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--adm-overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999; /* Very high z-index to appear above everything */
    padding: 20px;
    animation: adm-fadeIn 0.3s ease-out;
}

/* Prevent body scrolling when modal is open - but keep content visible */
body.admanager-modal-open {
    overflow: hidden !important;
}

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

/* Main container */
.admanager-login-container {
    background: white;
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    box-shadow: var(--adm-shadow);
    position: relative;
    animation: adm-slideIn 0.4s ease-out;
    z-index: 1000000; /* Even higher z-index for the container */
}

.admanager-login-form-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.admanager-login-hero-section {
    width: 420px;
    position: relative;
    overflow: hidden;
    border-radius: 0 16px 16px 0;
    background: linear-gradient(135deg, var(--adm-primary-color), var(--adm-secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.admanager-login-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
}

.admanager-login-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #262626;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000001; /* Keep high z-index for functionality */
    font-size: 18px;
    font-weight: 400;
    padding: 0;
    transition: color 0.2s ease;
}

.admanager-login-close:hover {
    color: #000000;
}

.admanager-login-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 24px;
}

.admanager-login-message {
    margin-bottom: 24px;
    padding: 12px 16px;
    border-radius: var(--adm-border-radius);
    display: none;
}

.admanager-login-message.error {
    background-color: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.admanager-login-message.success {
    background-color: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.admanager-login-social-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.admanager-login-social-btn {
    flex: 1;
    height: 40px;
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 12px;
}

.admanager-login-social-btn:hover {
    border-color: #d0d5dd;
    background-color: #f9fafb;
}

.admanager-login-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.admanager-login-divider::before,
.admanager-login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.admanager-login-divider span {
    font-size: 14px;
    color: #b3b2b6;
    font-weight: 500;
    line-height: 20px;
}

.admanager-login-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.admanager-login-field {
    margin-bottom: 16px;
}

.admanager-login-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #344054;
    margin-bottom: 6px;
    line-height: normal;
    letter-spacing: -0.32px;
}

.admanager-login-input {
    width: 100%;
    padding: 6px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 16px;
    color: #1f2937;
    background: white;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    height: 40px;
    line-height: 24px;
}

.admanager-login-input:focus {
    outline: none;
    border-color: var(--adm-primary-color);
    box-shadow: 0 0 0 3px rgba(241, 31, 104, 0.1);
}

.admanager-login-input::placeholder {
    color: #98a2b3;
}

.admanager-login-password-field {
    position: relative;
}

.admanager-login-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.admanager-login-password-toggle:hover {
    color: #374151;
}

.admanager-login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.admanager-login-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admanager-login-checkbox input {
    width: 16px;
    height: 16px;
}

.admanager-login-checkbox label {
    font-size: 14px;
    color: #0f0e11;
    font-weight: 500;
    margin-bottom: 0;
    line-height: 22px;
}

.admanager-login-forgot {
    font-size: 14px;
    color: var(--adm-primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: text-decoration 0.2s ease;
}

.admanager-login-forgot:hover {
    text-decoration: underline;
}

.admanager-login-submit {
    background: linear-gradient(135deg, #f11f68 0%, #162abf 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin: 24px 0 16px 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
}

.admanager-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(241, 31, 104, 0.4);
}

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

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

.admanager-login-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: adm-spin 1s linear infinite;
    display: none;
}

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

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

.admanager-login-signup {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    margin: 16px 0 20px 0;
    text-align: left;
}

.admanager-login-signup span {
    font-size: 14px;
    color: #344054;
    font-weight: 500;
    line-height: 22px;
}

.admanager-login-signup a {
    font-size: 14px;
    color: var(--adm-primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.admanager-login-signup a:hover {
    text-decoration: underline;
    color: #e11d48;
}

.admanager-login-terms {
    font-size: 14px;
    color: #344054;
    line-height: 22px;
    text-align: left;
    margin-top: 8px;
    font-weight: 400;
}

.admanager-login-hero-content {
    text-align: center;
    padding: 40px;
    position: relative;
    z-index: 2;
}

.admanager-login-hero-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.admanager-login-hero-subtitle {
    font-size: 18px;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admanager-login-overlay {
        padding: 16px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .admanager-login-container {
        flex-direction: column;
        max-width: 100%;
        width: 100%;
        max-height: calc(100vh - 40px);
        margin: 0;
        border-radius: 16px;
    }
    
    .admanager-login-hero-section {
        width: 100%;
        height: 200px;
        min-height: 200px;
        border-radius: 16px 16px 0 0;
        order: -1; /* Move hero to top on mobile */
    }
    
    .admanager-login-form-section {
        padding: 24px;
        flex: 1;
        overflow-y: auto;
    }
    
    .admanager-login-close {
        top: 16px;
        right: 16px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .admanager-login-title {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    .admanager-login-social-buttons {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .admanager-login-social-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admanager-login-overlay {
        padding: 12px;
        padding-top: 16px;
    }
    
    .admanager-login-container {
        max-height: calc(100vh - 32px);
        border-radius: 12px;
    }
    
    .admanager-login-hero-section {
        height: 160px;
        min-height: 160px;
        border-radius: 12px 12px 0 0;
    }
    
    .admanager-login-form-section {
        padding: 20px;
    }
    
    .admanager-login-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .admanager-login-field {
        margin-bottom: 14px;
    }
    
    .admanager-login-submit {
        margin: 20px 0 12px 0;
    }
}

@media (max-height: 600px) and (orientation: landscape) {
    .admanager-login-overlay {
        align-items: flex-start;
        padding: 8px;
        overflow-y: auto;
    }
    
    .admanager-login-container {
        max-height: none;
        margin: 8px 0;
    }
    
    .admanager-login-hero-section {
        height: 120px;
        min-height: 120px;
    }
    
    .admanager-login-form-section {
        padding: 16px;
    }
    
    .admanager-login-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .admanager-login-social-buttons {
        margin-bottom: 16px;
    }
    
    .admanager-login-field {
        margin-bottom: 12px;
    }
    
    .admanager-login-submit {
        margin: 16px 0 12px 0;
        padding: 12px 24px;
    }
}

/* Animation for modal appearance */
.admanager-login-modal.show {
    display: block;
}

.admanager-login-modal.show .admanager-login-overlay {
    animation: fadeIn 0.3s ease-out;
}

.admanager-login-modal.show .admanager-login-container {
    animation: slideIn 0.3s ease-out;
}

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

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to { 
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}
