/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Container chính cho form đăng ký */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.form-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Logo */
.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2563eb;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Form Content */
.form-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    margin-bottom: 15px;
}

.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.note {
    text-align: center;
    color: #ef4444;
    font-size: 0.85rem;
    margin-bottom: 25px;
    font-weight: 500;
}

/* Form Styles */
.registration-form {
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.form-group input:focus {
    outline: none;
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

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

.control-btn:active {
    transform: translateY(0);
}

.register-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.register-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.register-btn:active {
    transform: translateY(0);
}

/* Live Info */
.live-info {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.live-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.live-indicator span {
    color: #ef4444;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 20px 0;
}

.success-message h2 {
    color: #059669;
    margin-bottom: 15px;
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 20px;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #059669, #10b981);
    width: 0;
    animation: loading 3s ease-in-out forwards;
}

@keyframes loading {
    to { width: 100%; }
}

/* Error Messages */
.error-messages {
    margin-bottom: 20px;
}

.error {
    color: #dc2626;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* Background Animation */
.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.floating-element {
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-element:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-element:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

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

/* Livestream Page Styles */
.livestream-page {
    background: #0f172a;
    color: #f1f5f9;
    margin: 0;
    padding: 0;
}

.livestream-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.livestream-header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #334155;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-left .logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #3b82f6;
    margin: 0;
}

.header-center h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.participant-info, .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.participant-info i, .user-info i {
    color: #3b82f6;
}

/* Main Content */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 0;
    height: calc(100vh - 70px);
    overflow: hidden;
}

/* Video Section */
.video-section {
    background: #1e293b;
    position: relative;
    overflow: hidden;
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#livestream-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.video-info h3 {
    color: #f1f5f9;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.video-info p {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.video-controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.control-btn {
    background: rgba(59, 130, 246, 0.8);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.control-btn:hover {
    background: rgba(59, 130, 246, 1);
    transform: scale(1.05);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

#volume-slider {
    width: 100px;
    height: 4px;
    background: #475569;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

/* Chat Section */
.chat-section {
    background: #1e293b;
    border-left: 1px solid #334155;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: calc(100vh - 70px);
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid #334155;
    background: rgba(15, 23, 42, 0.8);
}

.chat-header h3 {
    color: #f1f5f9;
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-stats {
    color: #94a3b8;
    font-size: 0.85rem;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    scroll-behavior: smooth;
    max-height: calc(100vh - 250px);
}

.chat-message {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

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

.chat-message.user {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
}

.chat-message.bot {
    background: rgba(34, 197, 94, 0.1);
    border-left: 3px solid #22c55e;
}

.chat-message.system {
    background: rgba(168, 85, 247, 0.1);
    border-left: 3px solid #a855f7;
    font-style: italic;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.message-username {
    font-weight: 600;
    font-size: 0.85rem;
}

.message-username.user { color: #3b82f6; }
.message-username.bot { color: #22c55e; }
.message-username.system { color: #a855f7; }

.message-time {
    font-size: 0.75rem;
    color: #64748b;
}

.message-content {
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Chat Input */
.chat-input-container {
    padding: 15px;
    border-top: 1px solid #334155;
    background: rgba(15, 23, 42, 0.8);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 8px;
    color: #f1f5f9;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.3s ease;
}

#chat-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.send-btn {
    padding: 12px 15px;
    background: #3b82f6;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-btn:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.emoji-bar {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.emoji-btn {
    background: transparent;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.emoji-btn:hover {
    background: #334155;
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: 60vh 40vh;
        height: calc(100vh - 60px);
    }
    
    .livestream-header {
        height: 60px;
        padding: 8px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .chat-section {
        border-left: none;
        border-top: 1px solid #334155;
        max-height: 40vh;
    }
    
    .chat-messages {
        max-height: calc(40vh - 150px);
    }
    
    .header-center {
        order: 3;
        width: 100%;
        text-align: center;
    }
    
    .form-container {
        padding: 30px 25px;
        margin: 10px;
    }
    
    .video-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .volume-control {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .register-btn {
        order: 1;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 25px 20px;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .chat-messages {
        padding: 10px;
    }
    
    .emoji-bar {
        flex-wrap: wrap;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1e293b;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

