/* ==== MAIN STYLES ==== */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    transition: all 0.3s ease;
}

/* Dark Mode */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e6ed;
}

body.dark-mode .container {
    color: #e0e6ed;
}

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

/* ==== HEADER REDESIGN ==== */
.header {
    margin-bottom: 20px;
    position: relative;
    width: 100%;
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

.app-logo {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 8px 15px;
    border: 1px solid rgba(255,255,255,0.2);
    gap: 20px;
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.nav-btn-danger {
    background: rgba(220, 53, 69, 0.7);
}

.nav-btn-danger:hover {
    background: rgba(220, 53, 69, 0.9);
}

/* ==== DARK MODE TOGGLE (TOP RIGHT) ==== */
.dark-mode-toggle-container {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
}

.dark-mode-toggle-top {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dark-mode-toggle-top:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

body.dark-mode .dark-mode-toggle-top {
    background: rgba(30,41,59,0.8);
    border-color: rgba(255,255,255,0.2);
}

/* Responsive positioning */
@media (max-width: 768px) {
    .dark-mode-toggle-container {
        top: 15px;
        right: 10px;
    }
    
    .dark-mode-toggle-top {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex: 1;
}

.header-text {
    text-align: center;
}

.header-text h1 {
    color: white !important;
    font-size: 1.8rem;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    font-weight: 600;
}

.subtitle {
    color: rgba(255,255,255,0.9) !important;
    font-size: 0.85rem;
    margin: 2px 0 0 0;
}

.team-logo {
    border-radius: 50%;
}

.header-actions {
    position: absolute;
    top: 0;
    right: 0;
}

/* Make sure the button has proper styling */
.btn-icon {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn-icon:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Keep the original styles for backward compatibility but with lower specificity */
.header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    color: rgba(255,255,255,0.9);
    font-size: 1.1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-brand {
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .app-logo {
        font-size: 1.8rem;
    }
    
    .header-text h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .nav-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .nav-left, .nav-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* ==== HOME SCREEN ==== */
.home-screen {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    text-align: center;
    transition: all 0.3s ease;
}

body.dark-mode .home-screen {
    background: rgba(30,41,59,0.95);
    color: #e0e6ed;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.home-screen h2 {
    margin-bottom: 30px;
    color: #333;
    font-size: 2rem;
}

body.dark-mode .home-screen h2 {
    color: #e0e6ed;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* ==== BUTTONS ==== */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-reveal {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-clear {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

/* ==== INPUT GROUPS ==== */
.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    max-width: 400px;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 50px;
    font-size: 1rem;
    text-align: center;
    transition: border-color 0.3s ease;
    background: white;
    color: #333;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

body.dark-mode .input-group input {
    background: rgba(30,41,59,0.8);
    border-color: #4a5568;
    color: #e0e6ed;
}

body.dark-mode .input-group input:focus {
    border-color: #667eea;
}

body.dark-mode .input-group input::placeholder {
    color: #a0aec0;
}

/* ==== GAME ROOM ==== */
.game-room {
    display: none;
}

/* ==== ROOM HEADER ==== */
.room-header {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    transition: all 0.3s ease;
}

body.dark-mode .room-header {
    background: rgba(30,41,59,0.95);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.room-info h3 {
    color: #333;
    margin-bottom: 5px;
}

body.dark-mode .room-info h3 {
    color: #e0e6ed;
}

.room-code,
.room-name {
    background: #f0f2f5;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: monospace;
    font-weight: bold;
    color: #667eea;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

body.dark-mode .room-code,
body.dark-mode .room-name {
    background: rgba(102, 126, 234, 0.2);
    color: #90cdf4;
}

.admin-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ==== PLAYERS SECTION ==== */
.players-section {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

body.dark-mode .players-section {
    background: rgba(30,41,59,0.95);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

body.dark-mode .players-section h3 {
    color: #e0e6ed;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.player-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.player-card.voted {
    border-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

body.dark-mode .player-card {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: #e0e6ed;
}

body.dark-mode .player-card.voted {
    border-color: #48bb78;
    background: linear-gradient(135deg, #22543d 0%, #2f855a 100%);
}

.player-name {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

body.dark-mode .player-name {
    color: #e0e6ed;
}

.player-estimate {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-estimate.hidden {
    background: #667eea;
    color: #667eea;
    border-radius: 5px;
    user-select: none;
}

/* ==== VOTING SECTION ==== */
.voting-section {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

body.dark-mode .voting-section {
    background: rgba(30,41,59,0.95);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

body.dark-mode .voting-section h3 {
    color: #e0e6ed;
}

.voting-cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

/* ==== STATUS INDICATORS ==== */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
}

.status-waiting {
    background: #ffc107;
}

.status-voted {
    background: #28a745;
}

/* ==== ANIMATIONS ==== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: slideIn 0.5s ease-out;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .home-screen {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .room-header {
        flex-direction: column;
        text-align: center;
    }
    
    .players-grid {
        grid-template-columns: 1fr;
    }
}