/**
 * Main Stylesheet for BGG Signup System
 */

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

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Header */
.site-header {
    background: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

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

.site-title {
    font-size: 24px;
    margin: 0;
}

.site-title a {
    color: white;
    text-decoration: none;
}

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

/* Language Selector */
.language-selector select {
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #34495e;
    background: white;
    cursor: pointer;
}

/* User Menu */
.user-menu {
    position: relative;
    cursor: pointer;
}

.user-name {
    color: white;
    padding: 8px 15px;
    background: #34495e;
    border-radius: 4px;
    display: inline-block;
}

.user-name:after {
    content: ' ▼';
    font-size: 10px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    min-width: 150px;
    margin-top: 5px;
    display: none;
    z-index: 1000;
}

.user-menu.active .user-dropdown {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 15px;
    color: #333;
    border-bottom: 1px solid #eee;
}

.user-dropdown a:last-child {
    border-bottom: none;
}

.user-dropdown a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 10px;
}

.btn-login, .btn-register {
    padding: 8px 15px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.btn-login {
    background: #3498db;
}

.btn-login:hover {
    background: #2980b9;
}

.btn-register {
    background: #27ae60;
}

.btn-register:hover {
    background: #229954;
}

/* Main Content */
.site-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: calc(100vh - 200px);
}

/* Footer */
.site-footer {
    background: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin: 5px 0;
}

.powered-by {
    font-size: 12px;
    opacity: 0.8;
}

.powered-by a {
    color: #3498db;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

/* Game Item */
.gameitem {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

.gameitem.inactive {
    opacity: 0.6;
    background: #f0f0f0;
}

.gameitem .table {
    display: grid;
    grid-template-columns: 80px 1fr 120px 80px 80px 150px 150px 150px;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

/* Game Thumbnail */
.game_thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game_thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumbnail {
    font-size: 40px;
    color: #bdc3c7;
}

/* Game Name */
.game_name {
    font-size: 18px;
    font-weight: bold;
}

.game_name a {
    color: #2c3e50;
}

/* Game Weight/Difficulty */
.game_weight {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.weight-bar {
    width: 100%;
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.weight-fill {
    height: 100%;
    transition: width 0.3s;
}

.weight-value {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
}

/* Game Info Fields */
.game_players, .game_start, .game_who, .game_language, .game_rules {
    font-size: 13px;
    color: #555;
}

.game_start {
    font-weight: bold;
    font-size: 16px;
}

/* Initial Comment */
.game_initial_comment {
    grid-column: 1 / -1;
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #3498db;
    margin-top: 10px;
    font-style: italic;
}

/* Comment Section */
.game_comment {
    grid-column: 1 / -1;
}

.add_comment a {
    color: #3498db;
    font-size: 13px;
}

/* Players List */
.players {
    list-style: none;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.player-slot {
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.player-slot:last-child {
    border-bottom: none;
}

.player-slot.empty {
    color: #7f8c8d;
}

.player-slot.reserve {
    background: #fff3cd;
    padding: 8px;
    margin: 5px 0;
    border-radius: 4px;
}

.reserve-header {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ecf0f1;
}

.numer {
    font-weight: bold;
    color: #7f8c8d;
}

.name {
    color: #2c3e50;
    font-weight: bold;
}

.rules {
    font-size: 12px;
    color: #7f8c8d;
    font-style: italic;
}

.player_comment {
    font-size: 12px;
    color: #555;
}

/* Action Buttons */
.delete_player, .delete_game, .restore_game {
    margin-left: 10px;
}

.delete_player a, .delete_link, .edit_link, .resign-btn,
.join-game-btn, .join-reserve-btn, .add-comment-btn {
    color: #3498db;
    font-size: 12px;
    cursor: pointer;
}

.delete_link {
    color: #e74c3c;
    margin-right: 10px;
}

.delete_game, .restore_game {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
    text-align: right;
}

.restore-game-btn, .fully-delete-btn {
    padding: 5px 15px;
    border-radius: 4px;
    color: white;
    display: inline-block;
    margin-left: 10px;
}

.restore-game-btn {
    background: #27ae60;
}

.fully-delete-btn {
    background: #e74c3c;
}

.add_reserve a {
    display: inline-block;
    padding: 8px 15px;
    background: #f39c12;
    color: white;
    border-radius: 4px;
    margin-top: 10px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gameitem .table {
        grid-template-columns: 80px 1fr;
        gap: 10px;
    }
    
    .game_weight, .game_players, .game_start, .game_who,
    .game_language, .game_rules {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .gameitem .table {
        grid-template-columns: 1fr;
    }
    
    .game_thumbnail {
        width: 100%;
        height: 150px;
    }
}

/* Event Page Styles */
.event-container {
    max-width: 1200px;
    margin: 0 auto;
}

.no-event-message {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 8px;
}

.no-event-message h2 {
    color: #7f8c8d;
    margin-bottom: 10px;
}

/* Event Header */
.event-header {
    text-align: center;
    margin-bottom: 30px;
}

.event-title {
    font-size: 36px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.homepage-message {
    background: #e3f2fd;
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
    margin: 20px 0;
}

/* Day Tabs */
.day-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #ecf0f1;
}

.day-tab {
    padding: 12px 24px;
    background: #f8f9fa;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    text-decoration: none;
    color: #555;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.day-tab:hover {
    background: #e9ecef;
    text-decoration: none;
}

.day-tab.active {
    background: #3498db;
    color: white;
    font-weight: bold;
}

.day-date {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 3px;
}

.single-day-info {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 30px;
}

.day-time {
    margin-left: 15px;
    color: #7f8c8d;
}

/* Tables Container */
.tables-container {
    margin-bottom: 40px;
}

.table-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.table-header {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.games-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.no-games {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

/* Add Game/Table Buttons */
.add-game-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.btn-add-game, .btn-add-table {
    padding: 12px 30px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-add-game:hover, .btn-add-table:hover {
    background: #229954;
}

.add-table-section {
    text-align: center;
    padding: 30px;
}

/* Timeline */
.timeline-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.timeline-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #2c3e50;
}

.timeline {
    min-height: 200px;
}

.timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timeline-row {
    display: flex;
    align-items: stretch;
    min-height: 50px;
}

.timeline-table-label {
    width: 100px;
    padding: 10px;
    background: #34495e;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px 0 0 4px;
    font-weight: bold;
}

.timeline-games {
    flex: 1;
    position: relative;
    background: #f8f9fa;
    border: 1px solid #ecf0f1;
    border-radius: 0 4px 4px 0;
}

.timeline-game {
    position: absolute;
    top: 5px;
    bottom: 5px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.timeline-game:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 10;
}

.timeline-game-name {
    font-size: 13px;
    font-weight: bold;
}