/* Modal (Login/Register) Styles - High Performance v2.0 */

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

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

.login-content {
    background: #333333;
    width: 90%;
    max-width: 420px;
    position: relative;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 24px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    backdrop-filter: blur(4px);
}

.login-close:hover {
    background: rgba(255, 255, 255, 0.4);

}

/* Logo Area */
.login-logo {
   color:none;
}

.login-logo .logo-r {
    font-size: 42px;
    font-weight: bold;
    color: white;
    position: relative;
}

.login-logo .logo-tv {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 9px;
    color: white;
    font-weight: normal;
}

.login-app-name {
    font-size: 1.6rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 6px;
    text-align: center;
}

.login-welcome {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 25px;
    text-align: center;
}

/* Form Container and Toggle Animation */
.form-container {
    width: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-container.hidden {
    display: none;
}

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

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

/* Form Toggle Links */
.form-switch {
    text-align: center;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #ccc;
}

.form-switch a {
    color: #ff0058;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.form-switch a:hover {
    color: #ff5e00;
    text-decoration: underline;
}

/* Social Login Buttons */
.social-login {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.social-btn {
    width: 100%;
    padding: 12px 20px 12px 90px; /* Increased left padding to move content right */
    border: 1px solid #eee;
    border-radius: 30px; /* Pill shape */
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Left align content */
    gap: 12px;
    color: #333; /* Dark text */
    background: white;
    position: relative;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fafafa;
}

/* Remove old colored backgrounds */
.social-btn.google,
.social-btn.facebook,
.social-btn.apple,
.social-btn.guest {
    background-color: white;
    color: #333;
}

/* Icon Container */
.social-icon-img {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.social-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Guest Icon specific */
.social-btn.guest .social-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hide old social-icon if still used somewhere */
.social-icon {
    display: flex;
    align-items: center;
}

/* Google icon special styling */
.google-icon {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #4285F4;
}

/* Divider Line */
.login-divider {
    width: 100%;
    display: flex;
    align-items: center;
    margin: 15px 0;
    color: #ccc;
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.login-divider span {
    padding: 0 15px;
}

/* Email Login Form */
.email-login {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
}

.email-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s;
    box-sizing: border-box;
}

.email-input:focus {
    outline: none;
    border-color: #ff0058;
    background: white;
}

.email-input::placeholder {
    color: #999;
}

.email-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #ff0058, #ff5e00);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.email-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 88, 0.3);
}

.email-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* OTP Verification Styles */
.otp-option {
    width: 100%;
    margin-bottom: 15px;
}

.otp-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    color: #ccc;
    font-size: 0.9rem;
}

.otp-checkbox input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s;
}

.otp-checkbox input[type="checkbox"]:checked + .checkmark {
    background: #ff0058;
    border-color: #ff0058;
}

.otp-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.otp-text {
    flex: 1;
}

.otp-description {
    margin-top: 5px;
    font-size: 0.8rem;
    color: #999;
    margin-left: 28px;
}

.otp-verification {
    width: 100%;
    text-align: center;
}

.otp-header h3 {
    color: #fff;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.otp-instruction {
    color: #ccc;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.otp-input-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}

.otp-digit {
    width: 45px;
    height: 50px;
    border: 2px solid #555;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    transition: all 0.3s;
}

.otp-digit:focus {
    outline: none;
    border-color: #ff0058;
    background: rgba(255, 255, 255, 0.2);
}

.otp-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.resend-btn, .back-btn {
    background: transparent;
    color: #ccc;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.resend-btn:hover, .back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #777;
}

.btn-loading, .btn-countdown {
    display: none;
}

.btn-loading.show, .btn-countdown.show {
    display: inline;
}

.btn-text.hide {
    display: none;
}

/* Verification Code Row */
.verification-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.verification-input {
    flex: 1;
}

.verification-btn {
    white-space: nowrap;
    padding: 0 15px;
    background: #444;
    color: white;
    border: 1px solid #555;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.verification-btn:hover {
    background: #555;
    border-color: #666;
}

/* Bottom Agreement */
.login-agreement {
    text-align: center;
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.4;
    padding-top: 10px;
}

.login-agreement a {
    color: #fff;
    text-decoration: underline;
    transition: color 0.3s;
}

.login-agreement a:hover {
    color: #ff0058;
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    .login-content {
        padding: 30px 15px;
        max-width: 100%;
        margin: 0 20px;
        border-radius: 15px;
    }

    .login-app-name {
        font-size: 1.5rem;
    }

    .login-welcome {
        font-size: 0.9rem;
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
        border-radius: 15px;
    }
    
    .login-logo .logo-r {
        font-size: 36px;
    }
    
    .login-logo .logo-tv {
        font-size: 8px;
    }
    
    .social-btn {
        padding: 14px 20px;
        font-size: 0.9rem;
    }
    
    .email-input {
        padding: 14px;
        font-size: 1rem;
    }
    
    .email-submit {
        padding: 14px;
        font-size: 1rem;
    }
    
    .otp-digit {
        width: 40px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .otp-input-group {
        gap: 6px;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .login-content {
        margin: 0 10px;
        padding: 25px 15px;
        border-radius: 12px;
    }
    
    .login-app-name {
        font-size: 1.4rem;
    }
    
    .social-btn {
        padding: 12px 15px;
        gap: 10px;
        font-size: 0.85rem;
    }
    
    .social-icon {
        font-size: 18px;
    }
    
    .google-icon {
        width: 18px;
        height: 18px;
    }
    
    .otp-digit {
        width: 35px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .otp-input-group {
        gap: 4px;
    }
}

/* Performance Optimizations */
.login-modal,
.login-content,
.social-btn,
.email-submit {
    will-change: transform;
}

/* Accessibility */
.login-close:focus,
.social-btn:focus,
.email-input:focus,
.email-submit:focus {
    outline: 2px solid #ff0058;
    outline-offset: 2px;
}

/* Animation performance */
.form-container {
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Loading states */
.email-submit.loading {
    position: relative;
    color: transparent;
}

.email-submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

/* Loading spinner for social buttons */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* Social button loading state */
.social-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.social-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}