/* KiraX - Style CSS */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Header */
header.main-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    font-size: 1.8rem;
    margin-right: auto;
}

.logo a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.logo a:hover {
    opacity: 0.8;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.main-nav a:hover {
    opacity: 0.8;
}

.user-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn-dashboard, .btn-logout, .btn-join, .btn-lang {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.btn-dashboard {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-dashboard:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.btn-logout {
    background-color: #dc3545;
    color: white;
}

.btn-logout:hover {
    background-color: #c82333;
}

.btn-join {
    background-color: #28a745;
    color: white;
}

.btn-join:hover {
    background-color: #218838;
}

.btn-lang {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-lang:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Main Content */
.content-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 30px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content-container h2 {
    color: #667eea;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 1rem;
}

.content-container h3 {
    color: #764ba2;
    margin: 2rem 0 1rem;
}

.content-container p {
    margin-bottom: 1rem;
    color: #666;
}

/* Messages */
.message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    color: white;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background-color: #667eea;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
    margin: 1rem 0;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary:hover {
    background-color: #764ba2;
}

/* Secondary button style */
.btn-secondary {
    display: inline-block;
    background-color: #e9ecef;
    color: #333;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.12s;
    border: none;
    cursor: pointer;
}
.btn-secondary:hover { background-color: #dee2e6; }

/* Game tab buttons with icon */
.game-tab { display:inline-flex; gap:8px; align-items:center; padding:8px 12px; border-radius:6px; background:#fff; border:1px solid #ddd; cursor:pointer; }
.game-tab .icon { width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; }
.game-tab .label { font-weight:600; color:#333; }
.game-tab.active { background: linear-gradient(90deg,#f0f6ff,#f7f2ff); border-color:#cfdcff; }

.score { font-weight:700; color:#1a237e; }

/* Chess board container */
.chess-container { display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap; }
.chess-board { width: 420px; }
.chess-controls { max-width:360px; }
.chess-info { font-size:0.95rem; color:#444; margin-bottom:8px; }

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
    border-top: 3px solid #667eea;
}

/* Forms */
.form-container {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.auth-form {
    flex: 1;
    min-width: 300px;
    padding: 2rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.auth-form h3 {
    color: #667eea;
    margin-bottom: 1.5rem;
}

.auth-form input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
}

.auth-form button {
    width: 100%;
    background-color: #667eea;
    color: white;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.auth-form button:hover {
    background-color: #764ba2;
}

/* Listings Grid */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.listing-card {
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.listing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.listing-card h4 {
    color: #667eea;
    margin-bottom: 0.5rem;
}

.listing-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

/* Chat */
#chat-window {
    height: 300px;
    border: 1px solid #ddd;
    overflow-y: auto;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f9f9f9;
    border-radius: 4px;
}

#messages {
    list-style: none;
    padding: 0;
    margin: 0;
}

#messages li {
    padding: 0.8rem;
    margin: 0.5rem 0;
    background: #e9ecef;
    border-radius: 4px;
    word-wrap: break-word;
}

#chat-form {
    display: flex;
    gap: 0.5rem;
}

#m {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

#m:focus {
    outline: none;
    border-color: #667eea;
}

#chat-form button {
    padding: 0.8rem 1.5rem;
    background-color: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#chat-form button:hover {
    background-color: #764ba2;
}

#chat-form button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .user-controls {
        width: 100%;
        flex-direction: column;
    }

    .form-container {
        flex-direction: column;
    }

    .listings-grid {
        grid-template-columns: 1fr;
    }

    .content-container h2 {
        font-size: 1.5rem;
    }

    #chat-form {
        flex-direction: column;
    }

    #chat-form button {
        width: 100%;
    }
}
