/* Header-specific styles extracted from header.php */

/* Additional customizations to improve mobile experience */
body {
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior: none;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

input, button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.tap-target {
    position: relative;
    min-height: 48px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* Header styles to match footer width */
.header {
    width: 100%;
    background: linear-gradient(135deg, #1a2a3a, #2c3e50);
    color: #fff;
    padding: 25px 0; /* Tăng padding từ 20px lên 25px */
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #e74c3c);
}

.header h1 {
    margin: 0 0 15px 0; /* Thêm margin bottom cho tiêu đề */
    padding: 0 20px;
    text-align: center;
    color: #fff;
    font-size: 2em; /* Tăng kích thước chữ */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Language switcher styles */
.language-switcher {
    position: relative;
    margin-left: auto;
}

@media (max-width: 768px) {
    .language-switcher {
        order: -1;
        margin-left: 0;
        margin-right: auto;
    }
}

.nav-menu {
    display: flex;
    flex: 1;
    padding: 5px 0; /* Thêm padding top/bottom cho menu */
}

.nav-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px; /* Tăng khoảng cách giữa các menu items */
    flex-wrap: wrap;
}

.nav-menu ul li a {
    color: #b8c2cc;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 10px 15px; /* Tăng padding cho menu items */
    border-radius: 4px;
    font-size: 1.1em; /* Tăng kích thước chữ menu */
}

.nav-menu ul li a:hover,
.nav-menu ul li a.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.user-greeting {
    color: #b8c2cc;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

/* User dropdown styles */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    background: none;
    border: none;
    color: #b8c2cc;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: inherit;
}

.user-dropdown-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.user-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 5px;
}

.user-dropdown.active .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.logout-item:hover {
    background-color: #fff5f5;
    color: #dc3545;
}

.dropdown-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.login-link {
    margin-left: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .nav-menu ul {
        justify-content: center;
    }

    .user-greeting {
        justify-content: center;
    }

    .login-link {
        margin-left: 0;
    }

    .user-dropdown-menu {
        right: 50%;
        transform: translateX(50%) translateY(-10px);
    }

    .user-dropdown.active .user-dropdown-menu {
        transform: translateX(50%) translateY(0);
    }

    .header h1 {
        font-size: 1.8em;
        flex-direction: column;
        gap: 10px;
    }

    .header-logo {
        width: 35px;
        height: 35px;
    }
}

/* Main content area */
.main-content {
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* Fade in animation */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* Style cho form đăng nhập */
.login-form {
    max-width: 400px;
    margin: 0 auto;
}

.login-form .form-control {
    max-width: 100%;
    font-size: 16px;
}

/* Basic form styles */
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    height: 38px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

/* Style cho nút gửi mã */
.btn-send-code {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
    position: relative;
}

.btn-send-code:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.btn-send-code:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.btn-send-code:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading spinner */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Thông báo chờ */
.waiting-message {
    display: none;
    text-align: center;
    margin-top: 15px;
    color: #6c757d;
    font-size: 0.9em;
}

.waiting-message.show {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

/* Add styles for all plan types */
.plan-free {
    color: #28a745;
    font-weight: bold;
}

.plan-pro {
    color: #007bff;
    font-weight: bold;
}

.plan-business {
    color: #9333ea;
    font-weight: bold;
}

.plan-proplus, .plan-ultimate {
    color: #007bff;
    font-weight: bold;
}

/* Alert styles */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-error {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Support Dropdown Styles */
.support-dropdown {
    position: relative;
}

.support-toggle {
    background: none;
    border: none;
    color: #b8c2cc;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
    /* display: inline-block; */
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: inherit;
    text-decoration: none;
}

.support-toggle:hover,
.support-toggle.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.support-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 5px;
}

.support-dropdown.active .support-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.support-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
}

.support-dropdown-menu .dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.support-dropdown-menu .dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.support-dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa;
    color: #2c3e50;
}

/* Add Language Switcher Styles */
.language-switcher {
    position: relative;
    margin-right: 15px;
}

.language-toggle {
    background: none;
    border: none;
    color: #b8c2cc;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: inherit;
}

.current-language {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.current-language .language-flag {
    margin-right: 0;
    width: 18px;
    height: 13.5px;
}

.language-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.current-language {
    font-weight: 500;
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    margin-top: 5px;
    scrollbar-width: thin;
    scrollbar-color: #90A4AE #CFD8DC;
}

.language-dropdown::-webkit-scrollbar {
    width: 8px;
}

.language-dropdown::-webkit-scrollbar-track {
    background: #CFD8DC;
    border-radius: 0 8px 8px 0;
}

.language-dropdown::-webkit-scrollbar-thumb {
    background-color: #90A4AE;
    border-radius: 4px;
}

.language-switcher.active .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

/* RTL support for Arabic */
.language-item[href*="lang=ar"] {
    direction: rtl;
    text-align: right;
    justify-content: flex-end;
}

.language-item[href*="lang=ar"] .language-flag {
    order: 2;
    margin-right: 0;
    margin-left: 10px;
}

.language-item:first-child {
    border-radius: 8px 8px 0 0;
}

.language-item:last-child {
    border-radius: 0 0 8px 8px;
    border-bottom: none;
}

.language-item:hover {
    background-color: #f8f9fa;
}

.language-item.active {
    background-color: #e9ecef;
    font-weight: 500;
}

.language-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .language-switcher {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .language-dropdown {
        right: 50%;
        transform: translateX(50%) translateY(-10px);
    }

    .language-switcher.active .language-dropdown {
        transform: translateX(50%) translateY(0);
    }
}
