/* Game Voting App Styles */

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Content */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Auth Container */
.auth-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 450px;
    margin-bottom: 20px;
}

.auth-section {
    display: none;
}

.auth-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #4a5568;
    font-size: 2rem;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

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

.form-group input:invalid {
    border-color: #f56565;
}

/* Button Styles */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Auth Switch */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    color: #718096;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Message Container */
.message-container {
    width: 100%;
    max-width: 450px;
    margin-top: 20px;
}

.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
}

.message.success {
    background: #c6f6d5;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}

.message.error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.message.info {
    background: #bee3f8;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

/* Dashboard Styles */
.dashboard-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
}

.user-info {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
}

.user-info h2 {
    color: #4a5568;
    margin-bottom: 10px;
}

.user-email {
    color: #718096;
    font-size: 1.1rem;
}

.game-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.game-option {
    text-align: center;
    padding: 30px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.game-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.game-option h3 {
    margin-bottom: 10px;
    color: #4a5568;
}

.game-option p {
    color: #718096;
}

/* Game Code Input */
.game-code-input {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.game-code-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

/* Lobby Styles */
.lobby-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 600px;
}

.game-code-display {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.game-code-display .code {
    font-size: 3rem;
    font-weight: bold;
    color: #667eea;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.players-list {
    margin-bottom: 30px;
}

.players-list h3 {
    margin-bottom: 15px;
    color: #4a5568;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: #f7fafc;
    border-radius: 6px;
}

.player-number {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
}

/* Game Page Styles */
.game-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.round-info {
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
}

.timer {
    font-size: 3rem;
    font-weight: bold;
    color: #f56565;
    margin-bottom: 20px;
}

.timer.warning {
    color: #ed8936;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.voting-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.vote-btn {
    font-size: 1.5rem;
    padding: 20px 40px;
    min-width: 120px;
}

.vote-yes {
    background: #48bb78;
    color: white;
}

.vote-yes:hover {
    background: #38a169;
}

.vote-no {
    background: #f56565;
    color: white;
}

.vote-no:hover {
    background: #e53e3e;
}

/* Statistics Page */
.stats-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 800px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.stat-card h4 {
    color: #4a5568;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .auth-container {
        padding: 30px 20px;
    }
    
    .game-options {
        grid-template-columns: 1fr;
    }
    
    .voting-options {
        flex-direction: column;
        align-items: center;
    }
    
    .vote-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Statistics Page Styles */
.game-summary {
    background: #f7fafc;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

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

.summary-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.overall-stats {
    margin-bottom: 30px;
}

.player-stats {
    margin-bottom: 30px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-table th,
.stats-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.stats-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.stats-table tr:hover {
    background: #f7fafc;
}

.stats-table .current-user-row {
    background: #e6f3ff;
    border-left: 4px solid #667eea;
}

.stats-table .current-user-row:hover {
    background: #d1e9ff;
}

.you-badge {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.yes-votes {
    color: #48bb78;
    font-weight: 600;
}

.no-votes {
    color: #f56565;
    font-weight: 600;
}

.timeout-votes {
    color: #ed8936;
    font-weight: 600;
}

.round-breakdown {
    margin-bottom: 30px;
}

.round-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.round-header {
    background: #f7fafc;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.round-header h3 {
    margin: 0;
    color: #4a5568;
}

.round-summary {
    display: flex;
    gap: 15px;
}

.vote-count {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.vote-count.yes {
    background: #c6f6d5;
    color: #2f855a;
}

.vote-count.no {
    background: #fed7d7;
    color: #c53030;
}

.vote-count.timeout {
    background: #fbd38d;
    color: #c05621;
}

.round-details {
    padding: 20px;
}

.vote-list {
    display: grid;
    gap: 10px;
}

.vote-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 15px;
    align-items: center;
    padding: 10px;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.vote-item.current-user {
    background: #e6f3ff;
    border-color: #90cdf4;
}

.vote-choice {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    min-width: 50px;
}

.vote-choice.yes {
    background: #c6f6d5;
    color: #2f855a;
}

.vote-choice.no {
    background: #fed7d7;
    color: #c53030;
}

.vote-time {
    font-size: 0.9rem;
    color: #718096;
    min-width: 80px;
    text-align: right;
}

.vote-time.timeout {
    color: #c05621;
    font-weight: 600;
}

.stats-actions {
    text-align: center;
    padding: 30px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Turn order highlighting */
.player-item.current-turn {
    background: #e6f3ff;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.player-item.current-turn .player-number {
    background: #f56565;
    animation: pulse 1s infinite;
}

/* Additional responsive styles */
@media (max-width: 768px) {
    .stats-table {
        font-size: 0.9rem;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 8px 10px;
    }
    
    .vote-item {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .round-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .round-summary {
        align-self: stretch;
        justify-content: space-around;
    }
    
    .stats-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-actions .btn {
        width: 100%;
        max-width: 200px;
    }
}

/* Utility Classes */
.hidden {
    display: none;
}

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

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}