/* Reset et base */
* {
    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%);
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Layout principal */
.app-container {
    display: grid;
    grid-template-areas: 
        "header header"
        "main logs";
    grid-template-columns: 1fr 350px;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    gap: 1rem;
    padding: 1rem;
}

/* Header */
.app-header {
    grid-area: header;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-title {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.app-subtitle {
    color: #666;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Main content */
.app-main {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
    padding-right: 0.5rem;
}

/* Scrollbar personnalisée */
.app-main::-webkit-scrollbar {
    width: 8px;
}

.app-main::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.app-main::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.app-main::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Sections de contrôle */
.control-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Section Cast */
.cast-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.config-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: monospace;
    transition: border-color 0.3s ease;
}

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

.cast-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 0.9rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dc3545;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: #28a745;
}

.status-indicator.offline {
    background: #dc3545;
}

/* Boutons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

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

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

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Groupes d'éléments */
.input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.text-input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

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

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Section Participants */
.participants-display {
    margin-top: 1rem;
}

.participants-count {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #667eea;
}

.participants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.participant-card {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.participant-card:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.participant-name {
    font-weight: 500;
    color: #333;
}

.participant-score {
    color: #667eea;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.participant-score.visible {
    opacity: 1;
}

.participant-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.participant-remove:hover {
    background: #ffe6e6;
}

/* Section Configuration */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.config-item label {
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

/* Onglets de jeu */
.game-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e1e5e9;
    padding-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #f0f4ff;
    color: #667eea;
}

.tab-content {
    display: none;
}

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

.game-controls h3 {
    margin-bottom: 0.5rem;
    color: #333;
}

.game-controls p {
    margin-bottom: 1rem;
    color: #666;
    font-style: italic;
}

.timer-controls {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e1e5e9;
}

/* Section Logs */
.logs-section {
    grid-area: logs;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 140px);
}

.logs-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
}

.logs-container {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    max-height: 400px;
}

.logs-container::-webkit-scrollbar {
    width: 6px;
}

.logs-container::-webkit-scrollbar-track {
    background: #e1e5e9;
    border-radius: 3px;
}

.logs-container::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #e1e5e9;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.info {
    color: #28a745;
}

.log-entry.warning {
    color: #ffc107;
}

.log-entry.error {
    color: #dc3545;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        grid-template-areas: 
            "header"
            "main"
            "logs";
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    
    .logs-section {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .control-section {
        padding: 1rem;
    }
    
    .input-group,
    .button-group,
    .cast-controls {
        flex-direction: column;
    }
    
    .config-grid {
        grid-template-columns: 1fr;
    }
    
    .game-tabs {
        flex-wrap: wrap;
    }
    
    .participants-grid {
        grid-template-columns: 1fr;
    }
}