:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F9FAFB;
    --surface-color: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --border-color: #E5E7EB;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

header {
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 2rem 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

h1 {
    text-align: center;
    margin-top: 0;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
}

#tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary-color);
    background: #EEF2FF;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.bloc {
    display: none;
    animation: fadeIn 0.3s ease;
}

.bloc.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bloc-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.groupe {
    background: var(--surface-color);
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.groupe h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.competence {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.competence:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.competence h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.contexte {
    background: #F3F4F6;
    padding: 1rem;
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

textarea {
    flex-grow: 1;
    min-width: 250px;
    height: 80px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input[type="file"] {
    padding: 0.5rem 0;
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background: var(--primary-hover);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    background-color: var(--border-color);
    border-radius: var(--radius-md);
    height: 8px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.bloc-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.bloc-progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Detail View */
.hidden {
    display: none !important;
}

#detail-view {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    animation: fadeIn 0.3s ease;
}

.back-btn {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-btn:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.detail-card {
    background: var(--surface-color);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.detail-card h2 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.proofs-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.proofs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.proof-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--bg-color);
    position: relative;
}

.proof-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.proof-img-preview {
    max-width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
}

.proof-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    word-break: break-all;
    margin-bottom: 1rem;
}

.delete-proof-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #EF4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.delete-proof-btn:hover {
    background: #DC2626;
}

.view-btn {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    text-decoration: none;
    margin-top: auto;
}

.view-btn:hover {
    background: var(--primary-color);
    color: white;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    margin-top: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.competence-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.competence-link:hover {
    background: var(--bg-color);
}

.competence-link h4 {
    margin: 0;
    flex-grow: 1;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-oui {
    background: #D1FAE5;
    color: #065F46;
}

.status-non {
    background: #FEF2F2;
    color: #991B1B;
}

.status-empty {
    background: #F3F4F6;
    color: #4B5563;
}

.save-indicator {
    font-size: 0.85rem;
    color: #10B981;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.save-indicator.show {
    opacity: 1;
}

.status-coming {
    background: #FEF3C7;
    color: #92400E;
}