/* TamilChatHub Login Theme - Matching index.php style */

/* Main Background for Login Area */
#intro_top {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #fff;
    width: 100%;
    height: auto;
    z-index: 1;
    position: relative;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

/* Background Pattern */
#intro_top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="10" cy="60" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="90" cy="40" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Login Container - Compact and optimized */
#login_wrap {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

#login_all {
    width: 380px;
    max-width: 90%;
    border-radius: 18px;
    display: block;
    margin: 0 auto;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    position: relative;
    min-height: 360px;
    padding: 15px 18px 18px 18px !important;
}

/* Logo - Compact and properly displayed */
#login_logo {
    height: 55px !important;
    width: 55px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0.3rem auto 0.8rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.4rem !important;
    color: #667eea !important;
    font-weight: bold !important;
    box-shadow: none !important;
    max-width: 65px !important;
    max-height: 65px !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
}

#login_logo .logo_image {
    width: 55px !important;
    height: 55px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    image-rendering: -webkit-optimize-contrast !important;
    image-rendering: crisp-edges !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* Login Header */
.login_header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.login_header h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.login_header p {
    opacity: 0.9;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* Login Form */
.login_form {
    padding: 2rem;
}

.form_group {
    margin-bottom: 1.5rem;
}

.form_group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.form_group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form_group input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form_group input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

.form_group input:invalid {
    border-color: #ff6b6b;
}

/* Custom Button Styles for Chat System Buttons - Compact */
.intro_login_btn,
.intro_guest_btn {
    padding: 0.8rem 1.8rem !important;
    border: none !important;
    border-radius: 45px !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    margin-bottom: 0.8rem !important;
    width: 100% !important;
    max-width: 280px !important;
}

.intro_login_btn:hover,
.intro_guest_btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

.intro_login_btn.ok_btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52) !important;
    color: white !important;
}

.intro_guest_btn.default_btn {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

/* Text Styling for Chat System Classes - Compact hierarchy */
.text_xlarge {
    font-size: 1.5rem !important;
    font-weight: bold !important;
    color: white !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
    margin-top: 0.3rem !important;
    margin-bottom: 0.4rem !important;
    line-height: 1.2 !important;
}

.text_med {
    font-size: 1.1rem !important;
    opacity: 0.9 !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.text_xsmall {
    font-size: 0.9rem !important;
    opacity: 0.8 !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.bold {
    font-weight: bold !important;
}

.bclick {
    cursor: pointer !important;
    color: #ffd700 !important;
    text-decoration: underline !important;
    font-weight: bold !important;
    transition: color 0.3s ease !important;
}

.bclick:hover {
    color: white !important;
}

/* Spacing Classes - Compact layout optimization */
.vpad20 {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.bpad10 {
    padding-bottom: 5px !important;
}

.tpad20 {
    padding-top: 10px !important;
}

.tpad5 {
    padding-top: 3px !important;
}

.pad30 {
    padding: 0 !important;
}

.vpad15 {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.centered_element {
    text-align: center !important;
}

.clear {
    clear: both !important;
}

/* Language Selector */
#intro_lang {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
}

#intro_lang:hover {
    background: rgba(255, 255, 255, 0.2);
}

#intro_lang img {
    width: 20px;
    height: 15px;
    border-radius: 3px;
}

.language_flag {
    width: 20px;
    height: 15px;
    border-radius: 3px;
}

/* Section Styles */
.section {
    width: 100%;
    height: auto;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.12) 100%);
    backdrop-filter: blur(20px);
    padding: 60px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60"><defs><pattern id="tamilDots" width="30" height="30" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="1" fill="%23ffffff" opacity="0.06"/><circle cx="5" cy="25" r="0.5" fill="%23ffffff" opacity="0.04"/></pattern></defs><rect width="60" height="60" fill="url(%23tamilDots)"/></svg>');
    opacity: 0.5;
}

.section_content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 0;
    position: relative;
    z-index: 2;
}

.section_inside {
    margin: 0 auto;
    padding: 0 2rem;
}

/* Welcome Content */
.welcome_content {
    text-align: center;
}

.welcome_content h2 {
    font-size: 2.4em;
    color: mediumvioletred;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: -0.5px;
}

.welcome_content > p {
    font-size: 1.1em;
    color: brown;
    margin-bottom: 45px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Features Grid */
.features_grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
}

.feature_item {
    display: flex;
    align-items: center;
    text-align: left;
    padding: 25px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    backdrop-filter: blur(25px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature_item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feature_item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.feature_item:hover::before {
    opacity: 1;
}

.feature_icon {
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, #ff6b6b 0%, #e74c3c 100%);
    color: white;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-right: 18px;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(231, 76, 60, 0.35);
    position: relative;
    z-index: 2;
}

.feature_text h3 {
    font-size: 1.2em;
    color: darkblue;
    margin-bottom: 5px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
}

.feature_text p {
    color: firebrick;
    line-height: 1.5;
    margin: 0;
    font-size: 0.95em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

/* Form Validation */
.form_error {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

.form_success {
    color: #4caf50;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: none;
}

/* Loading State */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading .login_btn {
    opacity: 0.7;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design - Compact and optimized */
@media screen and (max-width: 768px) {
    #intro_top { min-height: auto; padding: 20px 0; }
    #login_all {
        width: 90%;
        padding: 12px 16px 16px 16px !important;
        min-height: 340px;
    }
    
    #login_logo {
        height: 55px !important;
        width: 55px !important;
        margin: 0.2rem auto 0.6rem !important;
    }
    
    #login_logo .logo_image {
        width: 55px !important;
        height: 55px !important;
    }
    
    .text_xlarge {
        font-size: 1.3rem !important;
    }
    
    .text_med {
        font-size: 1rem !important;
    }
    
    .login_form {
        padding: 1.2rem;
    }
    
    .login_header {
        padding: 1.2rem 1.2rem 0.8rem;
    }
    
    .login_header h1 {
        font-size: 1.3rem;
    }
    
    #intro_lang {
        top: 8px;
        right: 8px;
        width: 38px;
        height: 32px;
    }
    
    .intro_login_btn,
    .intro_guest_btn {
        padding: 0.7rem 1.5rem !important;
        font-size: 0.95rem !important;
    }
    
    /* Welcome Content & Features */
    .welcome_content h2 { font-size: 2em; }
    .welcome_content > p { font-size: 1em; margin-bottom: 35px; }
    .features_grid { grid-template-columns: 1fr; gap: 18px; max-width: 95%; }
    .feature_item { padding: 20px 18px; }
    .feature_icon { width: 50px; height: 50px; font-size: 20px; margin-right: 15px; }
    .feature_text h3 { font-size: 1.1em; }
    .feature_text p { font-size: 0.9em; }
    .section { padding: 40px 0; }
    
    /* Compact Footer responsive */
    #main_footer { padding: 15px 15px 10px; }
    #menu_main_footer ul { flex-direction: column; gap: 12px; }
    #menu_main_footer li { margin: 0; font-size: 12px; }
    #menu_main_footer li:first-child { margin-bottom: 5px; font-size: 12px; }
}

@media screen and (max-width: 480px) {
    #login_all {
        width: 95%;
        border-radius: 14px;
        padding: 14px 18px 18px 18px !important;
        min-height: 350px;
    }
    
    #login_logo {
        height: 50px !important;
        width: 50px !important;
        margin: 0.1rem auto 0.5rem !important;
    }
    
    #login_logo .logo_image {
        width: 50px !important;
        height: 50px !important;
    }
    
    .text_xlarge {
        font-size: 1.25rem !important;
    }
    
    .text_med {
        font-size: 0.95rem !important;
    }
    
    .login_form {
        padding: 0.8rem;
    }
    
    .login_header {
        padding: 0.8rem;
    }
    
    .login_header h1 {
        font-size: 1.25rem;
    }
    
    .form_group input {
        padding: 0.7rem;
    }
    
    .login_btn {
        padding: 0.7rem 1.1rem;
        font-size: 0.95rem;
    }
    
    .intro_login_btn,
    .intro_guest_btn {
        padding: 0.7rem 1.3rem !important;
        font-size: 0.95rem !important;
    }
    
    #modal_container .selectboxit-container,
    .custom-modal-container .selectboxit-container {
        width: 48% !important;
        margin-bottom: 0.6rem !important;
    }
    
    .custom-modal-container {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto !important;
    }
    
    #modal_container .selectboxit-list,
    .custom-modal-container .selectboxit-list {
        max-height: 120px !important;
        max-width: calc(100vw - 60px) !important;
    }
    
    .custom-modal-overlay {
        padding: 10px 5px !important;
    }
}

@media screen and (max-width: 1120px) {
    .section_inside {
        width: 96%;
    }
}


/* Animation Classes */
.fade_in {
    animation: fadeIn 0.5s ease-out;
}

.slide_in {
    animation: slideIn 0.4s ease-out;
}

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

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

/* Special Effects */
.glassmorphism {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient_text {
    background: linear-gradient(45deg, #ffd700, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* Style the injected login forms from the chat system */
#modal_container .login_form {
    padding: 0;
}

#modal_container #login_form_box,
#modal_container #guest_form_box,
#modal_container #registration_form_box {
    background: transparent;
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

#modal_container .modal_title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#modal_container .modal_content {
    margin-bottom: 1.5rem;
}

#modal_container .modal_content input,
#modal_container input.custom_input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin-bottom: 1rem;
}

#modal_container .modal_content input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#modal_container .modal_content input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

#modal_container .modal_control {
    margin-top: 1rem;
}

#modal_container .modal_control button,
#modal_container button.login_btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    margin-bottom: 1rem;
}

#modal_container .modal_control button:hover,
#modal_container button.login_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Style select dropdowns for guest login and registration - Fixed visibility */
#modal_container select,
#modal_container .selectboxit-container,
#modal_container .selectboxit-btn,
.custom-modal-container select,
.custom-modal-container .selectboxit-container,
.custom-modal-container .selectboxit-btn {
    width: 65% !important;
    padding: 0.9rem !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 22px !important;
    background: rgba(102, 126, 234, 0.3) !important;
    color: white !important;
    font-size: 0.95rem !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    margin-right: 2% !important;
    margin-bottom: 0.8rem !important;
    height: auto !important;
    min-height: 45px !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 1000 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Enhanced selectboxit styling for better visibility and containment */
#modal_container .selectboxit-container,
.custom-modal-container .selectboxit-container {
    display: inline-block !important;
    position: relative !important;
    vertical-align: top !important;
    z-index: 1000 !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
    max-width: 48% !important;
}

#modal_container .selectboxit-btn,
.custom-modal-container .selectboxit-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    text-align: left !important;
    padding-right: 2rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: rgba(102, 126, 234, 0.3) !important;
    color: white !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

#modal_container .selectboxit-arrow-container,
.custom-modal-container .selectboxit-arrow-container {
    position: absolute !important;
    right: 0.8rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    pointer-events: none !important;
    font-size: 0.8rem !important;
}

#modal_container .selectboxit-list,
.custom-modal-container .selectboxit-list {
    background: rgba(102, 126, 234, 0.95) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 12px !important;
    margin-top: 3px !important;
    max-height: 150px !important;
    overflow-y: auto !important;
    backdrop-filter: blur(12px) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
    z-index: 9999 !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Ensure dropdown stays within modal bounds */
    max-width: calc(100vw - 40px) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#modal_container .selectboxit-option,
.custom-modal-container .selectboxit-option {
    padding: 0.7rem 0.9rem !important;
    color: white !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

#modal_container .selectboxit-option:hover,
#modal_container .selectboxit-option.selectboxit-focus,
.custom-modal-container .selectboxit-option:hover,
.custom-modal-container .selectboxit-option.selectboxit-focus {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
}

#modal_container .selectboxit-option:last-child,
.custom-modal-container .selectboxit-option:last-child {
    border-bottom: none !important;
}

#modal_container select:focus,
.custom-modal-container select:focus {
    outline: none !important;
    border-color: #ffd700 !important;
    background: rgba(102, 126, 234, 0.4) !important;
    color: white !important;
}

#modal_container select option,
.custom-modal-container select option {
    background: #667eea !important;
    color: white !important;
    padding: 0.5rem !important;
    font-weight: 500 !important;
}

/* Style the form splits for registration - Fixed spacing */
#modal_container .form_split,
.custom-modal-container .form_split {
    display: flex;
    gap: 2%;
    margin-bottom: 0.8rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

#modal_container .form_left,
#modal_container .form_right,
.custom-modal-container .form_left,
.custom-modal-container .form_right {
    flex: 1;
    min-width: 0 !important;
    position: relative !important;
}

/* Fix for register_options specific styling */
#modal_container .register_options,
.custom-modal-container .register_options {
    margin-bottom: 0.5rem !important;
}

#modal_container .register_options .form_left,
#modal_container .register_options .form_right,
.custom-modal-container .register_options .form_left,
.custom-modal-container .register_options .form_right {
    width: 48% !important;
    display: inline-block !important;
    vertical-align: top !important;
}

/* Style forgot password link */
#modal_container .forgot_pass_elem {
    text-align: center;
    margin-top: 1rem;
}

#modal_container .forgot_password {
    color: #ffd700;
    cursor: pointer;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
}

#modal_container .forgot_password:hover {
    color: white;
}

/* Style recaptcha container - Remove empty circular elements */
#modal_container .recapcha_div,
.custom-modal-container .recapcha_div {
    display: none !important; /* Hide empty recaptcha containers */
}

#modal_container .tmargin15,
.custom-modal-container .tmargin15 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

#modal_container .register_recaptcha,
.custom-modal-container .register_recaptcha {
    display: none !important; /* Hide empty recaptcha elements */
}

/* Hide any other empty circular elements */
#modal_container .recapcha_div:empty,
.custom-modal-container .recapcha_div:empty,
#modal_container .register_recaptcha:empty,
.custom-modal-container .register_recaptcha:empty {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide elements that should be hidden */
#modal_container .hidden {
    display: none;
}

/* Style for system variables and error messages */
.custom-error-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 300px;
    word-wrap: break-word;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading state styles */
.loading-state {
    position: relative;
    pointer-events: none;
}

.loading-state::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Integration with chat system global styles */
body.chat-login-theme {
    overflow: hidden;
}

/* Ensure proper z-index for modals */
#login_all {
    z-index: 1000;
    position: relative;
}

/* Fix z-index for overModal (terms of use) */
#over_modal,
#over_emodal {
    z-index: 3000 !important;
}

#over_modal .modal_back,
#over_emodal .modal_back {
    z-index: 3001 !important;
}

#over_modal .over_modal_in,
#over_emodal .over_emodal_in {
    z-index: 3002 !important;
    position: relative !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4) !important;
}

#over_modal_content,
#over_emodal_content {
    color: white !important;
    padding: 2rem !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
}

#over_modal_content h2,
#over_emodal_content h2 {
    color: white !important;
    text-align: center !important;
    margin-bottom: 1.5rem !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
}

#over_modal_content p,
#over_emodal_content p {
    color: rgba(255, 255, 255, 0.9) !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
}

/* Style close button for over modals */
#over_modal .modal_close,
#over_emodal .modal_close {
    position: absolute !important;
    top: 1rem !important;
    right: 1rem !important;
    color: white !important;
    font-size: 1.5rem !important;
    cursor: pointer !important;
    z-index: 3003 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    transition: all 0.2s ease !important;
}

#over_modal .modal_close:hover,
#over_emodal .modal_close:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.1) !important;
}

/* Custom Modal Overlay Styles - Enhanced for dropdown containment */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: all 0.3s ease-out;
    overflow-y: auto !important;
    padding: 20px 10px !important;
    box-sizing: border-box !important;
}

.custom-modal-overlay.modal-show {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.custom-modal-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    transform: translateY(50px) scale(0.8);
    opacity: 0;
    transition: all 0.3s ease-out;
    margin: auto;
    /* Ensure dropdown containment */
    contain: layout style !important;
    color: white !important;
}

.custom-modal-overlay.modal-show .custom-modal-container {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.custom-modal-container .login_form {
    padding: 2rem;
}

.custom-modal-container .modal_title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    padding: 1.5rem 1.5rem 0;
}

.custom-modal-container .modal_content {
    padding: 0 2rem 1rem;
    color: white !important;
    background: transparent !important;
}

.custom-modal-container .modal_control {
    padding: 0 2rem 2rem;
    color: white !important;
    background: transparent !important;
}

/* Close button for modals */
.custom-modal-container::before {
    content: '×';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    color: white;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    line-height: 1;
}

.custom-modal-container::before:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
    color: #fff;
}


/* Optimize form element spacing */
#modal_container .modal_content > div,
.custom-modal-container .modal_content > div {
    margin-bottom: 0.8rem !important;
}

#modal_container .bpad15,
.custom-modal-container .bpad15 {
    padding-bottom: 0.6rem !important;
}

#modal_container .modal_content input,
.custom-modal-container .modal_content input {
    margin-bottom: 0.6rem !important;
}

/* Clear fix for form elements */
#modal_container .clear,
.custom-modal-container .clear {
    clear: both !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

/* Compact Modern Footer Styling - TamilChatHub Theme */
#main_footer {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%);
    backdrop-filter: blur(15px);
    color: #ffffff;
    padding: 18px 20px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    margin-top: 0;
}

#menu_main_footer {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
}

#menu_main_footer ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

#menu_main_footer li {
    display: inline-flex;
    align-items: center;
    margin: 0;
    font-size: 13px;
    position: relative;
}

#menu_main_footer li:first-child {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 6px;
    flex-basis: 100%;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

#menu_main_footer li:first-child .theme_color {
    color: #ffd700;
    font-weight: 600;
}

#menu_main_footer li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0;
    transition: all 0.3s ease;
    font-weight: 400;
    border-bottom: 1px solid transparent;
}

#menu_main_footer li a:hover {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.6);
}

#menu_main_footer li.bclick {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    padding: 0;
    transition: all 0.3s ease;
    font-weight: 400;
    border-bottom: 1px solid transparent;
}

#menu_main_footer li.bclick:hover {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.6);
}

#menu_main_footer li i {
    margin-right: 6px;
    font-size: 14px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Force dropdown text visibility and prevent white text on white background */
#modal_container .selectboxit-text,
.custom-modal-container .selectboxit-text {
    color: white \!important;
    font-weight: 500 \!important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) \!important;
}

/* Force visibility for all select-related elements */
#modal_container .selectboxit,
.custom-modal-container .selectboxit,
#modal_container .selectboxit *,
.custom-modal-container .selectboxit * {
    visibility: visible \!important;
    opacity: 1 \!important;
    display: block \!important;
    color: white \!important;
}

/* Ensure dropdown arrows are visible */
#modal_container .selectboxit-arrow,
.custom-modal-container .selectboxit-arrow {
    color: rgba(255, 255, 255, 0.8) \!important;
    visibility: visible \!important;
    opacity: 1 \!important;
}

/* Fix any potential white background issues */
#modal_container .selectboxit-container,
.custom-modal-container .selectboxit-container,
#modal_container .selectboxit-btn,
.custom-modal-container .selectboxit-btn {
    background: rgba(102, 126, 234, 0.3) \!important;
    color: white \!important;
}

/* Ensure dropdown list items have proper contrast */
#modal_container .selectboxit-list .selectboxit-option,
.custom-modal-container .selectboxit-list .selectboxit-option {
    background: rgba(102, 126, 234, 0.8) \!important;
    color: white \!important;
    font-weight: 500 \!important;
}
