/* 
 * Stylesheet cho Ứng dụng Bình chọn World Cup 2026
 * Thiết kế theo phong cách Glassmorphism và Sleek Dark Mode hiện đại.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-card: rgba(17, 24, 39, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(6, 182, 212, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #06b6d4;      /* Neon Cyan */
    --accent-secondary: #ec4899;    /* Neon Pink */
    --accent-success: #10b981;      /* Emerald Green */
    --accent-warning: #f59e0b;      /* Amber Yellow */
    --accent-danger: #ef4444;       /* Rose Red */
    
    --gradient-primary: linear-gradient(135deg, #06b6d4 0%, #ec4899 100%);
    --gradient-button: linear-gradient(90deg, #06b6d4 0%, #3b82f6 100%);
    
    --font-sans: 'Outfit', sans-serif;
    --shadow-glow: 0 0 15px rgba(6, 182, 212, 0.4);
    --shadow-glow-pink: 0 0 15px rgba(236, 72, 153, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background elements for depth */
body::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
    top: 10%;
    left: -50px;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
    bottom: 15%;
    right: -100px;
    z-index: -1;
    pointer-events: none;
}

/* Header & Navigation */
header {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    font-size: 1.8rem;
}

nav {
    display: flex;
    gap: 0.5rem;
}

.nav-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: var(--accent-primary);
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.05);
}

/* Main Layout */
main {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.tab-content.active {
    display: block;
}

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

/* Cards & Layout grids */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 8px 32px 0 rgba(6, 182, 212, 0.05);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.card-title-accent {
    color: var(--accent-primary);
}

/* Leaderboard Table */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.leaderboard-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.rank-cell {
    font-weight: 700;
    width: 50px;
}

.rank-first { color: #ffd700; text-shadow: 0 0 8px rgba(255, 215, 0, 0.3); }
.rank-second { color: #c0c0c0; text-shadow: 0 0 8px rgba(192, 192, 192, 0.3); }
.rank-third { color: #cd7f32; text-shadow: 0 0 8px rgba(205, 127, 50, 0.3); }

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

.money-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.money-good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.money-bad {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.05);
}

/* Matches List styling */
.match-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.match-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(6, 182, 212, 0.2);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.match-stage-badge {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(6, 182, 212, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.match-status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.status-pending { background: rgba(148, 163, 184, 0.1); color: var(--text-secondary); }
.status-voting { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); border: 1px solid rgba(16, 185, 129, 0.3); animation: pulse 2s infinite; }
.status-closed { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-finished { background: rgba(59, 130, 246, 0.15); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.3); }

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

.match-teams-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin: 1rem 0;
}

.match-team {
    font-size: 1.2rem;
    font-weight: 700;
    flex: 1;
    text-align: center;
}

.match-team.team-a { text-align: right; }
.match-team.team-b { text-align: left; }

.match-score-display {
    font-size: 1.8rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 1rem;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
    letter-spacing: 2px;
}

.match-details-row {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    padding-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.match-details-row span strong {
    color: var(--text-primary);
}

/* Progress bar for votes */
.vote-progress-container {
    margin-top: 1rem;
}

.vote-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.vote-progress-bar-bg {
    height: 8px;
    background: rgba(236, 72, 153, 0.2); /* Team B color background */
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.vote-progress-bar-fill {
    height: 100%;
    background: var(--accent-primary); /* Team A color fill */
    transition: width 0.5s ease;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-button);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
    background: var(--accent-danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-block {
    width: 100%;
}

/* Server Status Info Widget */
.status-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.status-dot.warning {
    background-color: var(--accent-warning);
    box-shadow: 0 0 8px var(--accent-warning);
}

/* TEAMS SIMULATOR COMPONENT */
.simulator-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 1.5rem;
    height: calc(100vh - 180px);
    min-height: 500px;
}

@media (max-width: 1000px) {
    .simulator-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
}

.simulator-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
}

.teams-window {
    background: #1f1f23; /* Teams dark mode chat window background */
    border: 1px solid #2d2d30;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.teams-header {
    background: #29292c;
    border-bottom: 1px solid #3c3c3f;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.teams-avatar-group {
    background: #4f4f53;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.85rem;
}

.teams-chat-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #f3f3f5;
}

.teams-chat-subtitle {
    font-size: 0.75rem;
    color: #adadad;
}

.teams-messages-container {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.teams-message-row {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    align-self: flex-start;
}

.teams-message-row.self {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.teams-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3c5e8c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 700;
}

.teams-msg-bot {
    background: #5b5fc7; /* Microsoft purple */
}

.teams-msg-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.teams-msg-author {
    font-size: 0.75rem;
    color: #adadad;
    font-weight: 600;
}

.teams-message-row.self .teams-msg-author {
    text-align: right;
}

.teams-msg-bubble {
    background: #2d2d30;
    padding: 0.75rem 1rem;
    border-radius: 0 8px 8px 8px;
    color: #f3f3f5;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.teams-message-row.self .teams-msg-bubble {
    background: #3b3b40;
    border-radius: 8px 0 8px 8px;
}

/* Simulated Adaptive Card in Teams Chat */
.teams-adaptive-card {
    background: #2d2d30; /* Dark adaptive card bg */
    border: 1px solid #3c3c3f;
    border-radius: 8px;
    padding: 1.25rem;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.teams-adaptive-card .ac-title {
    font-size: 1rem;
    font-weight: 700;
    color: #6264a7; /* Teams Purple Accent */
    margin-bottom: 0.5rem;
}

.teams-adaptive-card .ac-text {
    font-size: 0.9rem;
    color: #f3f3f5;
    margin-bottom: 0.5rem;
}

.teams-adaptive-card .ac-bold {
    font-weight: 700;
}

.teams-adaptive-card .ac-fact-set {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.teams-adaptive-card .ac-fact-title {
    color: #adadad;
    font-weight: 600;
}

.teams-adaptive-card .ac-fact-value {
    color: #f3f3f5;
}

.teams-adaptive-card .ac-column-set {
    display: flex;
    gap: 1.5rem;
    margin: 0.75rem 0;
}

.teams-adaptive-card .ac-column {
    flex: 1;
}

.teams-adaptive-card .ac-divider {
    border-top: 1px solid #3c3c3f;
    margin: 0.75rem 0;
}

.teams-adaptive-card .ac-btn-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.teams-adaptive-card .ac-btn {
    flex: 1;
    background: #6264a7; /* Microsoft Teams Purple */
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.teams-adaptive-card .ac-btn:hover {
    background: #4f5087;
}

/* Teams Chat Input Area */
.teams-chat-input-area {
    background: #202024;
    border-top: 1px solid #2d2d30;
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.teams-chat-input {
    flex: 1;
    background: #2d2d30;
    border: 1px solid #3c3c3f;
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    color: #f3f3f5;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.teams-chat-input:focus {
    outline: none;
    border-color: #6264a7;
}

.teams-chat-send-btn {
    background: #6264a7;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.teams-chat-send-btn:hover {
    background: #4f5087;
}

/* Teams Adaptive Card Table rendering styling */
.ac-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.85rem;
}

.ac-table th {
    border-bottom: 1px solid #3c3c3f;
    padding: 0.4rem;
    text-align: left;
    color: #adadad;
}

.ac-table td {
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding: 0.5rem 0.4rem;
    color: #f3f3f5;
}

.ac-table tr.ac-header-row {
    background: rgba(255,255,255,0.03);
}

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}
