/* Mobile Responsive Styles for Vietnamese Hangman Game Hub */

/* Mobile Base Styles - apply to all screen sizes */
.game-hub-section {
    padding: 20px 0;
    background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.game-hub-header {
    text-align: center;
    margin-bottom: 20px;
}

.game-hub-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
    margin: 0 auto;
}

/* Game Options Cards */
.game-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.option-card {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    color: #333;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.option-card .btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 10px;
}

/* Online Players Section */
.online-players-section {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: #333;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.online-players-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 15px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Touch-friendly buttons */
.btn {
    min-height: 44px; /* Minimum touch target size */
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
}

.btn-sm {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 14px;
}

/* Modals for mobile */
.modal-content {
    width: 100%;
    max-width: 100%;
    margin: 10px;
    border-radius: 12px;
}

.modal-body {
    padding: 15px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Notification styles */
.notification {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
    margin: 0 auto;
    top: 10px;
    text-align: center;
    z-index: 2000;
}

/* Challenge waiting indicator */
.challenge-waiting {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.challenge-waiting-content {
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    max-width: 80%;
}

/* Tablet styles */
@media (min-width: 768px) {
    .game-hub-section {
        padding: 30px 0;
    }
    
    .game-options {
        grid-template-columns: 1fr 1fr;
    }
    
    .game-hub-content {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .game-options {
        flex: 1;
        min-width: 45%;
    }
    
    .online-players-section {
        flex: 1;
        min-width: 45%;
    }
    
    .modal-content {
        width: 90%;
        max-width: 500px;
        margin: 0 auto;
    }
    
    .notification {
        width: auto;
        max-width: 400px;
        right: 20px;
        left: auto;
        text-align: left;
    }
}

/* Desktop styles */
@media (min-width: 1200px) {
    .game-hub-section {
        padding: 40px 0;
    }
    
    .game-hub-content {
        max-width: 1200px;
        flex-direction: row;
    }
    
    .game-options {
        flex: 2;
    }
    
    .online-players-section {
        flex: 1;
        max-width: 400px;
        max-height: none;
    }
    
    .online-players-container {
        max-height: 500px;
    }
    
    .modal-content {
        max-width: 600px;
    }
}

/* Special styles for online players list */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.player-item {
    transition: background-color 0.2s ease;
}

.player-item:hover {
    background-color: #e9e9e9;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.player-details {
    display: flex;
    flex-direction: column;
}

.player-name {
    font-weight: 500;
    color: #1a2a6c;
}

.player-status {
    font-size: 0.8rem;
    color: #666;
}

.player-actions {
    display: flex;
    gap: 10px;
}

/* Loading spinner and empty state */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top: 4px solid #1a2a6c;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-players-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.no-players-message p {
    margin: 5px 0;
}

/* Game mode selection for mobile */
.game-modes-info {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.game-modes-info h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #1a2a6c;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-option input[type="radio"] {
    min-width: 20px;
    min-height: 20px;
}

.mode-option label {
    cursor: pointer;
    font-size: 1rem;
}

/* Quick match button styling */
.quick-match-button {
    width: 100%;
    margin-top: 15px;
    padding: 12px;
    font-size: 1.1rem;
    background-color: #1a2a6c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.quick-match-button:hover {
    background-color: #111c45;
}

/* Guest badge styling */
.guest-badge {
    background-color: #ffcc00;
    color: #333;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
    display: inline-block;
    margin-left: 5px;
    vertical-align: middle;
}

/* Challenge modals */
.challenge-player-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.challenge-player-info .player-avatar {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

.challenge-player-info h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #1a2a6c;
}

.challenge-details {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
}

.detail-item {
    margin-bottom: 8px;
}

.detail-label {
    font-weight: 500;
    margin-right: 5px;
}

.challenge-timer {
    text-align: center;
    margin-top: 15px;
    color: #666;
}

#challenge-timer {
    font-weight: 700;
    color: #e74c3c;
}

/* Form controls for challenge/match settings */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
}

select.form-control {
    height: 44px; /* Touch-friendly height */
    background-color: white;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 768px) {
    .radio-group {
        flex-direction: row;
        gap: 20px;
    }
}

/* Match finding modal adjustments */
.match-finding-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.match-status {
    font-size: 1.1rem;
    margin: 10px 0;
    color: #1a2a6c;
}

.match-time {
    font-size: 0.9rem;
    color: #666;
}

.match-preferences {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 15px;
}

.match-preferences h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #1a2a6c;
}

/* Modal footer styling */
.modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Pulsing button animation for user attention */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(26, 42, 108, 0.7);
    }
    
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(26, 42, 108, 0);
    }
    
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(26, 42, 108, 0);
    }
}

.btn-pulse {
    animation: pulse 2s infinite;
}

/* Custom scrollbar for better UX */
.online-players-container::-webkit-scrollbar {
    width: 6px;
}

.online-players-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.online-players-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.online-players-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Active player highlighting */
.player-item.active {
    border-left: 4px solid #1a2a6c;
    background-color: rgba(26, 42, 108, 0.05);
}

/* Tab adjustments for better mobile experience */
.waiting-room-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.tab {
    padding: 10px 15px;
    white-space: nowrap;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.tab.active {
    color: #1a2a6c;
    border-bottom-color: #1a2a6c;
    font-weight: 500;
}

.tab-content {
    display: none;
}

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

/* Bottom floating action button for mobile */
.floating-action-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #1a2a6c;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.floating-action-button i {
    font-size: 24px;
}

.floating-action-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Mobile-specific adjustments */
@media (max-width: 480px) {
    .game-hub-header h1 {
        font-size: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .option-card {
        padding: 15px 10px;
    }
    
    .option-card h3 {
        font-size: 1.2rem;
    }
    
    .option-card p {
        font-size: 0.8rem;
    }
    
    .option-card .btn {
        padding: 10px;
    }
    
    .modal-content {
        margin: 10px;
    }
    
    .challenge-details {
        font-size: 0.9rem;
    }
}