/* Thêm vào css/style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

.container {
    max-width: 1260px; /* Tăng 5% từ 1200px */
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 a {
    color: white;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #34495e;
}

/* Main content */
main {
    min-height: calc(100vh - 140px);
    padding: 20px 0;
}

/* Hero section */
.hero {
    text-align: center;
    padding: 60px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 2.625rem; /* Tăng 5% từ 2.5rem */
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.26rem; /* Tăng 5% từ 1.2rem */
    margin-bottom: 30px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12.6px 25.2px; /* Tăng 5% */
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 1.05rem; /* Tăng 5% từ 1rem */
    transition: background-color 0.3s;
    margin: 0 10px;
}

.btn:hover {
    background-color: #2980b9;
}

.btn-primary {
    background-color: #e74c3c;
}

.btn-primary:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(315px, 1fr)); /* Tăng 5% từ 300px */
    gap: 31.5px; /* Tăng 5% từ 30px */
    margin-top: 40px;
}

.feature {
    background: white;
    padding: 31.5px; /* Tăng 5% từ 30px */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.feature h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Forms */
.auth-form {
    max-width: 525px; /* Tăng 5% từ 500px */
    margin: 0 auto;
    background: white;
    padding: 31.5px; /* Tăng 5% từ 30px */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Game */
.game-container {
    background: white;
    padding: 21px; /* Tăng 5% từ 20px */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.game-info {
    margin-bottom: 21px; /* Tăng 5% từ 20px */
    padding-bottom: 15.75px; /* Tăng 5% từ 15px */
    border-bottom: 1px solid #eee;
}

.your-turn {
    color: #27ae60;
    font-weight: bold;
}

.opponent-turn {
    color: #e74c3c;
}

#chessboard {
    width: 420px; /* Tăng 5% từ 400px */
    margin: 0 auto 21px; /* Tăng 5% từ 20px */
}

.game-controls {
    text-align: center;
}

/* Ranking table */
.ranking-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12.6px 15.75px; /* Tăng 5% từ 12px 15px */
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #2c3e50;
    color: white;
}

.current-user {
    background-color: #ecf0f1;
}

.rating {
    font-weight: bold;
    color: #e74c3c;
}

/* Error messages */
.error {
    background-color: #e74c3c;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 11px 0; /* Tăng 5% từ 20px */
    margin-top: 22px; /* Tăng 5% từ 40px */
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
    }
    
    nav ul {
        margin-top: 15px;
    }
    
    .hero h2 {
        font-size: 2.1rem; /* Tăng 5% từ 2rem */
    }
    
    #chessboard {
        width: 100%;
        max-width: 420px; /* Tăng 5% từ 400px */
    }
}
/* Thêm vào css/style.css */

.highlight {
    background-color: rgba(255, 255, 0, 0.4) !important;
}

.move-dots {
    background-color: rgba(0, 255, 0, 0.3);
    border-radius: 50%;
}

.chess-clock {
    background: #2c3e50;
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-size: 1.575em; /* Tăng 5% từ 1.5em */
    font-weight: bold;
    margin: 10px 0;
}

.game-controls {
    margin: 21px 0; /* Tăng 5% từ 20px */
    text-align: center;
}

.control-btn {
    margin: 5px;
    padding: 8.4px 15.75px; /* Tăng 5% từ 8px 15px */
    background: #3498db;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.control-btn:hover {
    background: #2980b9;
}

.control-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

#status {
    font-weight: bold;
    padding: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    margin: 10px 0;
    text-align: center;
}

#pgn {
    background: white;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    max-height: 200px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.945em; /* Tăng 5% từ 0.9em */
}
/* Profile Styles */
.profile-header {
    display: flex;
    align-items: center;
    background: white;
    padding: 31.5px; /* Tăng 5% từ 30px */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 31.5px; /* Tăng 5% từ 30px */
}

.avatar-section {
    text-align: center;
    margin-right: 42px; /* Tăng 5% từ 40px */
}

.avatar-large {
    width: 157.5px; /* Tăng 5% từ 150px */
    height: 157.5px; /* Tăng 5% từ 150px */
    border-radius: 50%;
    object-fit: cover;
    border: 5.25px solid #3498db; /* Tăng 5% từ 5px */
    margin-bottom: 15px;
}

.avatar-small {
    width: 31.5px; /* Tăng 5% từ 30px */
    height: 31.5px; /* Tăng 5% từ 30px */
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.avatar-preview {
    width: 105px; /* Tăng 5% từ 100px */
    height: 105px; /* Tăng 5% từ 100px */
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.profile-info h1 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.slogan {
    font-style: italic;
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 1.155em; /* Tăng 5% từ 1.1em */
}

.rating-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    text-align: center;
}

.rating-badge .rating {
    font-size: 1.575em; /* Tăng 5% từ 1.5em */
    font-weight: bold;
    display: block;
}

.rating-badge .rating-label {
    font-size: 0.945em; /* Tăng 5% từ 0.9em */
}

.location-info {
    margin-top: 15px;
}

.location-info i {
    margin-right: 5px;
    color: #e74c3c;
}

/* Stats Section */
.stats-section, .ranking-section, .bio-section {
    background: white;
    padding: 26.25px; /* Tăng 5% từ 25px */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 26.25px; /* Tăng 5% từ 25px */
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(157.5px, 1fr)); /* Tăng 5% từ 150px */
    gap: 21px; /* Tăng 5% từ 20px */
    margin-top: 20px;
}

.stat-card {
    text-align: center;
    padding: 21px; /* Tăng 5% từ 20px */
    border-radius: 8px;
    background: #f8f9fa;
}

.stat-number {
    font-size: 2.1em; /* Tăng 5% từ 2em */
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-number.win {
    color: #27ae60;
}

.stat-number.loss {
    color: #e74c3c;
}

.stat-number.draw {
    color: #f39c12;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.945em; /* Tăng 5% từ 0.9em */
}

/* Ranking Section */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); /* Tăng 5% từ 200px */
    gap: 21px; /* Tăng 5% từ 20px */
    margin-top: 20px;
}

.rank-card {
    text-align: center;
    padding: 26.25px; /* Tăng 5% từ 25px */
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.rank-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.155em; /* Tăng 5% từ 1.1em */
}

.rank-number {
    font-size: 2.625em; /* Tăng 5% từ 2.5em */
    font-weight: bold;
}

/* Bio Section */
.bio-content {
    line-height: 1.6;
    color: #555;
}

/* Edit Profile */
.edit-profile-form {
    background: white;
    padding: 31.5px; /* Tăng 5% từ 30px */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 31.5px; /* Tăng 5% từ 30px */
    padding-bottom: 21px; /* Tăng 5% từ 20px */
    border-bottom: 1px solid #eee;
}

.form-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.avatar-upload {
    text-align: center;
}

.avatar-upload input[type="file"] {
    margin: 10px 0;
}

/* Ranking Filters */
.ranking-filters {
    background: white;
    padding: 21px; /* Tăng 5% từ 20px */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 26.25px; /* Tăng 5% từ 25px */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); /* Tăng 5% từ 200px */
    gap: 21px; /* Tăng 5% từ 20px */
}

.filter-section h3 {
    margin: 0 0 10px 0;
    font-size: 1.05em; /* Tăng 5% từ 1em */
    color: #2c3e50;
}

/* Player Info in Table */
.player-info {
    display: flex;
    align-items: center;
}

/* Success Message */
.success {
    background-color: #27ae60;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .avatar-section {
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .stats-grid,
    .ranking-grid,
    .ranking-filters {
        grid-template-columns: 1fr;
    }
}

/* Challenges Styles */
.challenges-section, .opponents-section, .ranking-info {
    background: white;
    padding: 26.25px; /* Tăng 5% từ 25px */
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 26.25px; /* Tăng 5% từ 25px */
}

.challenge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
}

.challenge-info {
    flex: 1;
}

.challenge-status {
    text-align: right;
}

.status-pending { color: #f39c12; }
.status-accepted { color: #27ae60; }
.status-rejected { color: #e74c3c; }
.status-completed { color: #3498db; }

.opponents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(315px, 1fr)); /* Tăng 5% từ 300px */
    gap: 21px; /* Tăng 5% từ 20px */
    margin-top: 20px;
}

.opponent-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 21px; /* Tăng 5% từ 20px */
    text-align: center;
}

.opponent-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.opponent-info > div {
    text-align: left;
    margin-left: 15px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(262.5px, 1fr)); /* Tăng 5% từ 250px */
    gap: 21px; /* Tăng 5% từ 20px */
    margin-top: 20px;
}

.info-card {
    padding: 21px; /* Tăng 5% từ 20px */
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.info-card h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

/* Champion Badge */
.champion-badge {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.26em; /* Tăng 5% từ 1.2em */
    font-weight: bold;
}

/* Ranking Progression */
.progression-section {
    margin-top: 26.25px; /* Tăng 5% từ 25px */
    padding-top: 21px; /* Tăng 5% từ 20px */
    border-top: 1px solid #eee;
}

.progression-stats {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.positive { color: #27ae60; }
.negative { color: #e74c3c; }

/* Rank Badges */
.rank-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.84em; /* Tăng 5% từ 0.8em */
    margin-top: 5px;
}

.top-10 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #000;
}

/* Action Buttons */
.action-buttons {
    text-align: center;
    margin-top: 26.25px; /* Tăng 5% từ 25px */
}

.action-buttons .btn {
    margin: 0 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .challenge-item {
        flex-direction: column;
        text-align: center;
    }
    
    .challenge-status {
        margin-top: 10px;
    }
    
    .progression-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .opponent-info {
        flex-direction: column;
        text-align: center;
    }
    
    .opponent-info > div {
        margin-left: 0;
        margin-top: 10px;
        text-align: center;
    }
}