:root {
    --jci-blue: #0097d7;
    --jci-dark: #005f8a;
    --bg-color: #f4f7f6;
    --box-bg: #ffffff;
    --text-color: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.app-container {
    display: flex;
    background-color: var(--box-bg);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    max-width: 1000px;
    width: 100%;
    overflow: hidden;
    min-height: 600px;
}

/* Sidebar gauche fixe */
.sidebar {
    width: 280px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    padding: 2rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.lang-switch {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.lang-btn {
    background-color: #edf2f7;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lang-btn.active {
    background-color: var(--jci-blue);
    color: white;
    border-color: var(--jci-blue);
}

.sidebar-header {
    margin-bottom: 1.5rem;
}

.sidebar-header h1 {
    color: var(--jci-blue);
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
}

.sidebar-header p {
    color: #666;
    font-size: 0.9rem;
}

/* Navigation verticale dans la sidebar */
.tab-navigation {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--jci-blue);
    background: #f1f5f9;
}

.tab-btn.active {
    color: var(--jci-blue);
    background: #e0f2fe;
    border-left: 4px solid var(--jci-blue);
}

/* Zone de contenu principale à droite */
.content-area {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    max-height: 100vh;
    background-color: var(--box-bg);
}

.tab-content {
    width: 100%;
}

/* Onglet 1 - Générateur */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

select {
    padding: 0.8rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

select:focus {
    border-color: var(--jci-blue);
}

button#spin-button {
    background-color: var(--jci-blue);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

button#spin-button:hover:not(:disabled) {
    background-color: var(--jci-dark);
}

button#spin-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.result-container {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#result-box {
    padding: 1.5rem;
    border: 2px dashed var(--jci-blue);
    border-radius: 8px;
    width: 100%;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

.spinning {
    filter: blur(2px);
    opacity: 0.6;
}

.roles-container {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
    width: 100%;
}

.role-card {
    flex: 1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
}

.role-title {
    display: block;
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.role-value {
    display: block;
    font-size: 1.15rem;
    font-weight: 800;
    color: #333;
}

.role-value.pour { color: #16a34a; }
.role-value.contre { color: #dc2626; }

/* Onglet 2 - Chronomètre */
.summary-banner {
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.summary-topic {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--jci-dark);
    margin-bottom: 0.4rem;
}

.summary-roles {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}

.timer-mode-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.mode-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--jci-blue);
    background: white;
    color: var(--jci-blue);
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn.active {
    background: var(--jci-blue);
    color: white;
}

.timer-display-card {
    background: #1e293b;
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
    text-align: center;
}

.step-title {
    font-size: 1rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    min-height: 1.5em;
}

.timer-digits {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Courier New', Courier, monospace;
    color: #38bdf8;
    margin: 0.5rem 0 1rem 0;
    letter-spacing: 2px;
}

.timer-digits.warning { color: #facc15; }
.timer-digits.time-up { color: #ef4444; }

.timer-controls {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-timer {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

.btn-timer.primary { background-color: #10b981; color: white; }
.btn-timer.finish { background-color: #0284c7; color: white; }
.btn-timer.secondary { background-color: #475569; color: white; }
.btn-timer:disabled { opacity: 0.4; cursor: not-allowed; }

.speaker-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.speaker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
}

.speaker-item.active {
    border-left: 4px solid var(--jci-blue);
    background: #e0f2fe;
    font-weight: bold;
}

.speaker-name { font-size: 0.95rem; color: #334155; }
.speaker-duration { font-size: 0.85rem; color: #0284c7; font-weight: 700; }
.speaker-recorded { font-size: 0.85rem; font-weight: 700; padding: 0.2rem 0.5rem; border-radius: 4px; }
.speaker-recorded.recorded { background-color: #dcfce7; color: #16a34a; }
.speaker-recorded.overtime { background-color: #fee2e2; color: #dc2626; }

.custom-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.custom-inputs input {
    width: 65px;
    padding: 0.5rem;
    font-size: 1rem;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    text-align: center;
}

.separator-colon { font-weight: bold; font-size: 1.2rem; color: #475569; }

/* Onglet 3 - Synthèse des règles (Design inspiré officiel) */
.rules-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
}

.rules-card h2 {
    color: var(--jci-dark);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.alert-box {
    background-color: #eff6ff;
    border-left: 4px solid var(--jci-blue);
    padding: 1rem;
    border-radius: 0 6px 6px 0;
    margin-bottom: 1rem;
}

.alert-box h4 { color: var(--jci-dark); margin-bottom: 0.3rem; }
.alert-box p { font-size: 0.9rem; color: #334155; }

.styled-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.styled-table th, .styled-table td {
    padding: 0.75rem 1rem;
    text-align: left;
}

.styled-table th {
    background-color: var(--jci-dark);
    color: white;
    font-weight: 600;
}

.styled-table tr:nth-child(even) { background-color: #f8fafc; }
.styled-table tr:not(:last-child) td { border-bottom: 1px solid #e2e8f0; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-pro { background-color: #dbeafe; color: #1e40af; }
.badge-con { background-color: #fee2e2; color: #991b1b; }

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.card {
    background: white;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 1.2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.card h3 {
    font-size: 1rem;
    color: var(--jci-dark);
    margin-bottom: 0.7rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.4rem;
}

.card ul { list-style-type: none; }
.card li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1rem;
    font-size: 0.85rem;
    color: #475568;
    line-height: 1.4;
}
.card li::before {
    content: "•";
    color: var(--jci-blue);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.hidden { display: none !important; }

/* Crédits dans la sidebar */
.credits {
    margin-top: 2rem;
    text-align: left;
    font-size: 0.8rem;
    color: #555;
    background-color: #edf2f7;
    padding: 0.8rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.credits-author { margin-bottom: 0.3rem; }

/* Responsive mobile */
@media (max-width: 768px) {
    body { padding: 0; align-items: stretch; }
    .app-container { flex-direction: column; border-radius: 0; box-shadow: none; }
    .sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid #e2e8f0; padding: 1.5rem; }
    .tab-navigation { flex-direction: row; flex-wrap: wrap; }
    .tab-btn { flex: 1; text-align: center; }
    .tab-btn.active { border-left: none; border-bottom: 3px solid var(--jci-blue); }
    .content-area { max-height: none; padding: 1.5rem; }
}