* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ===== FORM ĐĂNG NHẬP / ĐĂNG KÝ ===== */
.form-container {
    background: white;
    border-radius: 30px;
    padding: 30px 25px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 100%;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo-area {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.logo-area h1 {
    color: #075E54;
    font-size: 28px;
    margin-bottom: 5px;
}

.logo-area p {
    color: #666;
    font-size: 14px;
}

.form-title {
    font-size: 24px;
    color: #075E54;
    margin-bottom: 25px;
    text-align: center;
    font-weight: 600;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    z-index: 1;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8f9fa;
    outline: none;
}

.input-group select {
    padding: 15px 15px 15px 45px;
    appearance: none;
    background: #f8f9fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 15px center;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #128C7E;
    background: white;
    transform: scale(1.02);
}

.input-group input::placeholder {
    color: #bbb;
}

.double-group {
    display: flex;
    gap: 10px;
}

.double-group .input-group {
    flex: 1;
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-submit.loading {
    opacity: 0.7;
    cursor: wait;
}

.btn-submit.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.form-footer {
    text-align: center;
    margin-top: 25px;
    color: #666;
}

.form-footer a {
    color: #128C7E;
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

.alert {
    padding: 12px 15px;
    border-radius: 25px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.alert-error {
    background: #fee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.remember-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 15px 0;
    padding: 0 10px;
}

.remember-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.forgot-link {
    color: #128C7E;
    text-decoration: none;
    font-size: 14px;
}

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: #e0e0e0;
}

.divider span {
    background: white;
    padding: 0 10px;
    position: relative;
    color: #999;
    font-size: 12px;
}

.btn-guest {
    width: 100%;
    padding: 12px;
    background: white;
    color: #075E54;
    border: 2px solid #075E54;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-guest:active {
    background: #f0f0f0;
    transform: scale(0.98);
}

.password-strength {
    margin-top: 8px;
    font-size: 12px;
    padding-left: 15px;
}

.strength-weak { color: #f44336; }
.strength-medium { color: #ff9800; }
.strength-strong { color: #4caf50; }

/* ===== CHAT CONTAINER ===== */
.chat-container {
    max-width: 500px;
    margin: 0 auto;
    background: #e5ddd5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Profile Header */
.profile-header {
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.5);
}

.avatar-medium {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.xu {
    font-size: 14px;
    color: #FFD700;
    display: inline-block;
    background: rgba(0,0,0,0.2);
    padding: 4px 10px;
    border-radius: 20px;
}

/* Chat Box */
.chat-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100vh - 180px);
    background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Message Styles */
.message {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.my-message {
    background: #DCF8C6;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.other-message {
    background: white;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

.message-header strong {
    color: #075E54;
    font-size: 13px;
}

.message-content {
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.message-time {
    font-size: 10px;
    color: #999;
    text-align: right;
    margin-top: 4px;
}

/* Message Form */
.message-form {
    display: flex;
    padding: 10px;
    background: #f0f0f0;
    gap: 8px;
    position: sticky;
    bottom: 60px;
    border-top: 1px solid #ddd;
}

.message-form input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.message-form input:focus {
    border-color: #128C7E;
    box-shadow: 0 0 0 2px rgba(18,140,126,0.1);
}

.message-form button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
}

.message-form button:active {
    transform: scale(0.95);
}

/* Bottom Menu */
.bottom-menu {
    display: flex;
    justify-content: space-around;
    background: white;
    padding: 8px 0;
    position: sticky;
    bottom: 0;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.bottom-menu a {
    text-decoration: none;
    color: #666;
    font-size: 12px;
    text-align: center;
    flex: 1;
    padding: 8px 5px;
    transition: all 0.3s;
    border-radius: 10px;
}

.bottom-menu a i {
    display: block;
    font-size: 22px;
    margin-bottom: 4px;
}

.bottom-menu a.active {
    color: #075E54;
    background: #e8f5e9;
}

.bottom-menu a:active {
    transform: scale(0.95);
}

/* Profile Edit Page */
.profile-edit-box {
    background: white;
    min-height: 100vh;
    padding: 20px;
}

.profile-edit-box h2 {
    color: #075E54;
    margin-bottom: 20px;
    text-align: center;
    font-size: 24px;
}

.profile-edit-box h3 {
    color: #075E54;
    margin: 20px 0 15px;
    font-size: 18px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
}

.profile-edit-box label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.profile-edit-box input,
.profile-edit-box select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
}

.profile-edit-box input:focus,
.profile-edit-box select:focus {
    border-color: #128C7E;
}

.profile-edit-box button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: white;
    border: none;
    border-radius: 12px;
    margin-top: 15px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s;
}

.profile-edit-box button:active {
    transform: scale(0.98);
}

.current-avatar {
    text-align: center;
    margin-bottom: 20px;
}

.current-avatar img {
    border: 3px solid #075E54;
    padding: 3px;
}

.menu-links {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

.menu-links a {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: #f5f5f5;
    color: #075E54;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s;
}

.menu-links a:active {
    background: #e0e0e0;
    transform: scale(0.98);
}

/* Coming Soon Pages */
.coming-soon {
    text-align: center;
    padding: 60px 20px;
    background: white;
    min-height: 100vh;
}

.coming-soon h2 {
    color: #075E54;
    font-size: 32px;
    margin-bottom: 20px;
}

.coming-soon p {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
}

.coming-soon a {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: transform 0.2s;
}

.coming-soon a:active {
    transform: scale(0.95);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #075E54;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #128C7E;
}

/* Responsive */
@media (max-width: 500px) {
    .container {
        padding: 0;
    }
    
    .form-container {
        border-radius: 0;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .chat-container {
        border-radius: 0;
    }
    
    .message {
        max-width: 90%;
    }
    
    .bottom-menu a {
        font-size: 10px;
    }
    
    .bottom-menu a i {
        font-size: 20px;
    }
    
    .profile-edit-box {
        padding: 15px;
    }
    
    .double-group {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 380px) {
    .profile-header {
        padding: 10px;
    }
    
    .avatar-large {
        width: 50px;
        height: 50px;
    }
    
    .profile-info h3 {
        font-size: 16px;
    }
    
    .xu {
        font-size: 12px;
    }
    
    .bottom-menu a i {
        font-size: 18px;
    }
    
    .message {
        max-width: 95%;
    }
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No messages */
.no-messages {
    text-align: center;
    padding: 40px;
    color: #999;
}

.no-messages i {
    font-size: 50px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Badge */
.badge {
    display: inline-block;
    background: #f44336;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 5px;
}