.experience-card.new {
  background-color: #b2b7f1;
  box-shadow: #09175d 0 0 0.3rem;
}

/* For long skill names, the dropdown might be too big */
.exp-body-offset-top {
  padding-top: 40px !important;
}

.crud-buttons-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  justify-content: center;
  translate: 0 1.4rem;
}

.date-group {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  padding-left: 20px;
}

.date-field {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  width: 100%;
  max-width: 180px;
}

.date-field label {
  text-align: left;
  flex-grow: 0.1;
}

.date-field input {
  max-width: 130px;
  text-align: right;
}

@media (max-width: 600px) {
  .date-group {
    flex-direction: column;
  }

  .date-field {
    align-items: flex-start;
    align-self: flex-end;
  }
}

.left-group {
  display: flex;
  flex-direction: column;

  label, input {
    flex: 1;
    margin: 0 0.5rem;
  }
}

.right-section-edit {
  text-align: right;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 12rem;
}

.title-group {
  display: flex;
  justify-content: space-between;
  align-items: center;

  label, input {
    flex: 1;
    margin: 0 0.5rem;
  }
}

.location {
  input {
    max-width: 9.3rem;
  }
}

.description {
  padding-right: 5px;
}

input[type="text"],
textarea,
select {
  /* Input styles */
  flex: 4;
}

textarea {
  width: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  resize: vertical;
}

.form-card {
  border: 0.3rem solid #000754;
}

.form-skills-filter {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
}

.form-skill-button {
  flex-shrink: 0;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  width: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  color: #475569;
  transition: all 0.2s ease;
}
.form-skill-button:hover { background: #e2e8f0; border-color: #94a3b8; }
.form-skill-button.add {
  width: auto;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.form-skill-button.delete { background: #fecaca; border-color: #f87171; color: #dc2626; }
.form-skill-button.delete:hover { background: #fef2f2; border-color: #ef4444; }

.form-buttons-container {
  display: flex;
  justify-content: center;

  button[type="submit"],
  button#cancel-update-btn {
    margin: 5px 0 5px 10px;
    width: 100px;
  }
}

/* ============ Edit Form Styling ============ */

/* Form card styling */
.form-card {
    border: 0.3rem solid var(--season-primary);
    position: relative;
}

.form-card.new {
    background-color: #b2b7f1;
    box-shadow: #09175d 0 0 0.3rem;
}

/* Form header styling */
.form-card .exp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.form-card .dates-location {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-project .form-group,
.dates-location .form-group {
    margin: 0;
    padding: 0;
}

/* Company input */
.company-group input {
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--default-font-color);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: auto;
    box-shadow: none;
}

.company-group input:focus {
    outline: 2px solid var(--season-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Dates styling */
.form-dates {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-group input[type="date"] {
    background: transparent;
    border: none;
    color: var(--default-font-color);
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    width: auto;
}

.date-group input[type="date"]:focus {
    outline: 2px solid var(--season-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

.date-separator {
    color: var(--default-font-color);
    opacity: 0.7;
}

/* Location styling */
.form-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--default-font-color);
}

.form-location i {
    color: var(--default-font-color);
    opacity: 0.7;
}

.location-group input {
    background: transparent;
    border: none;
    color: var(--default-font-color);
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    width: auto;
}

.location-group input:focus {
    outline: 2px solid var(--season-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
}

/* Title styling */
.form-card .exp-card-title {
    margin: 12px 0;
}

.form-card .exp-card-title .title-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    background: #f8fafc;
}

.form-card .exp-card-title .title-fieldset legend {
    padding: 0 8px;
    color: var(--season-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    width: auto;
}

/* Title translation groups - vertical layout with inline labels */
.form-card .exp-card-title .translation-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Hide internal fieldsets if they exist */
.form-card .exp-card-title .translation-group {
    display: contents;
}

/* Project and Description fieldsets - same style as title */
.form-card .exp-card-body .project-fieldset,
.form-card .exp-card-body .description-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    width: 100%;
    background: #f8fafc;
    margin-bottom: 12px;
}

.form-card .exp-card-body .project-fieldset legend,
.form-card .exp-card-body .description-fieldset legend {
    padding: 0 8px;
    color: var(--season-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    width: auto;
}

/* Project languages grid - 2 per row (6/12 each) */
.experience-project .project-languages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.experience-project .project-language-item {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    background: white;
}

.experience-project .language-flag {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.experience-project .project-field {
    margin-bottom: 8px;
}

.experience-project .project-field:last-child {
    margin-bottom: 0;
}

.experience-project .project-field input,
.experience-project .project-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    box-sizing: border-box;
}

.experience-project .project-field input:focus,
.experience-project .project-field textarea:focus {
    outline: 2px solid var(--season-secondary);
    border-color: var(--season-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Responsive for project grid */
@media (max-width: 600px) {
    .experience-project .project-languages-grid {
        grid-template-columns: 1fr;
    }
}

/* Description languages grid - 2 per row (6/12 each) */
.experience-description .description-languages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.experience-description .description-language-item {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    background: white;
}

.experience-description .language-flag {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.experience-description .description-field {
    margin-bottom: 8px;
}

.experience-description .description-field:last-child {
    margin-bottom: 0;
}

.experience-description .description-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    box-sizing: border-box;
    min-height: 100px;
    resize: vertical;
}

.experience-description .description-field textarea:focus {
    outline: 2px solid var(--season-secondary);
    border-color: var(--season-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Responsive for description grid */
@media (max-width: 600px) {
    .experience-description .description-languages-grid {
        grid-template-columns: 1fr;
    }
}

/* Hide internal fieldsets in project and description */
.form-card .exp-card-body .translation-group {
    display: contents;
}

/* Style for translated fields in project and description */
.form-card .exp-card-body .translated-field,
.form-card .exp-card-body .description-group {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-card .exp-card-body .translated-field:last-child,
.form-card .exp-card-body .description-group:last-child {
    margin-bottom: 0;
}

.form-card .exp-card-body .translated-field label,
.form-card .exp-card-body .description-group label {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--default-font-color);
}

.form-card .exp-card-body .translated-field input,
.form-card .exp-card-body .translated-field textarea,
.form-card .exp-card-body .description-group textarea {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    box-sizing: border-box;
}

.form-card .exp-card-body .translated-field input:focus,
.form-card .exp-card-body .translated-field textarea:focus,
.form-card .exp-card-body .description-group textarea:focus {
    outline: 2px solid var(--season-secondary);
    border-color: var(--season-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-card .exp-card-title .translated-field {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-card .exp-card-title .translated-field:last-child {
    margin-bottom: 0;
}

.form-card .exp-card-title .translated-field label {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--default-font-color);
}

.form-card .exp-card-title .translated-field input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    box-sizing: border-box;
}

.form-card .exp-card-title .translated-field input:focus {
    outline: 2px solid var(--season-secondary);
    border-color: var(--season-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.title-group input {
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--default-font-color);
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    box-shadow: none;
}

.title-group input:focus {
    outline: 2px solid var(--season-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 6px;
    border-radius: 4px;
}

/* Project styling - container only, styling now handled by fieldset */
.form-card .experience-project {
    margin-bottom: 0;
}

/* Default translation groups (for project and description) - keep original grid layout */
.translation-groups {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.translation-group {
    min-width: 0;
    margin: 0 0 10px;
    padding: 8px;
    border: 1px solid #dbe3ec;
    border-radius: 6px;
}

.translation-group legend {
    padding: 0 5px;
    color: var(--season-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.translated-field {
    margin-bottom: 8px;
}

.translated-field:last-child {
    margin-bottom: 0;
}

.translated-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--default-font-color);
    margin-bottom: 4px;
}

.translated-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
    box-sizing: border-box;
}

.translated-field input:focus {
    outline: 2px solid var(--season-secondary);
    border-color: var(--season-secondary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.project-group input,
.project-description-group textarea {
    background: transparent;
    border: none;
    color: var(--default-font-color);
    padding: 4px 0;
    margin: 2px 0;
    width: 100%;
    font-size: 0.95rem;
}

.project-group input:focus,
.project-description-group textarea:focus {
    outline: 2px solid var(--season-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 8px;
    border-radius: 4px;
}

.project-group label,
.project-description-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--season-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Description styling - container only, styling now handled by fieldset */
.form-card .form-description {
    margin-bottom: 0;
}

/* Skills and body containers */
.experience-skills,
.experience-body {
    width: 100%;
    padding: 0 12px;
}

.description-group textarea {
    background: transparent;
    border: none;
    color: var(--default-font-color);
    padding: 4px 0;
    margin: 2px 0;
    width: 100%;
    font-size: 0.95rem;
    resize: none;
    min-height: auto;
}

.description-group textarea.markdown-editor {
    min-height: 220px;
    resize: vertical;
    white-space: pre-wrap;
}

.description-group textarea:focus {
    outline: 2px solid var(--season-secondary);
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 8px;
    border-radius: 4px;
    min-height: 100px;
    resize: vertical;
}

.markdown-help {
    display: block;
    color: #64748b;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-top: 6px;
}

.description-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--season-primary);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Options styling */
.form-card .form-options {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--season-primary);
}

.form-card .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--default-font-color);
    margin: 4px 0;
}

.form-card .checkbox-label input[type="checkbox"] {
    display: none;
}

.form-card .checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--season-primary);
    border-radius: 4px;
    position: relative;
    display: inline-block;
}

.form-card .checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: "✓";
    position: absolute;
    left: 2px;
    top: -2px;
    color: var(--season-primary);
    font-size: 14px;
    font-weight: bold;
}

/* Add experience container - column layout with action row + CV button */
.add-experience-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.add-experience-container .action-buttons-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-experience-container .action-btn {
    width: 40px;
    height: 40px;
    background: var(--season-secondary);
    border: none;
    color: var(--season-primary);
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.add-experience-container .action-btn:hover {
    background: var(--season-primary);
    color: white;
    transform: scale(1.05);
}

.add-experience-container .action-btn i {
    font-size: 1.2rem;
}

/* Download CV button - full width of 4 buttons, inverted colors */
.add-experience-container .download-cv-btn {
    width: 184px; /* 4 * 40px + 3 * 8px gap */
    height: 40px;
    background: var(--season-primary);
    color: white;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.add-experience-container .download-cv-btn:hover {
    background: var(--season-secondary);
    color: var(--season-primary);
    transform: scale(1.05);
}

.add-experience-container .download-cv-btn i {
    font-size: 1.1rem;
}

/* Form actions styling - now in header next to location */
.form-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.form-actions .action-btn {
    background: transparent;
    border: none;
    color: var(--season-primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-actions .action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.form-actions .action-btn.submit:hover {
    background: #a7f3d0;
    color: #065f46;
}

.form-actions .action-btn.cancel:hover {
    background: #fecaca;
    color: #dc2626;
}

/* Form info styling */
.form-info {
    text-align: center;
    color: var(--season-primary);
    font-size: 0.8rem;
    padding: 12px;
    background: rgba(194, 170, 170, 0.1);
    border-radius: 6px;
    margin-bottom: 12px;
}

.form-info i {
    margin-right: 6px;
}

/* Error message styling */
.form-card .error-message {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

/* Skills form styling */
.exp-skills-container {
    width: 100%;
}

.form-card .exp-skills-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Skill level controls grid - 4 elements per row: - (1) | barre (9) | + (1) | bin (1) */
.exp-skill-container .skill-controls-grid {
    display: grid;
    grid-template-columns: 1fr 9fr 1fr 1fr;
    gap: 4px;
    align-items: center;
    width: 100%;
}

.exp-skill-container .control-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.exp-skill-container .control-cell.progress {
    justify-content: flex-start;
    min-width: 0;
}

/* En mode non connecté, il n'y a que la barre (pas de boutons +/- et corbeille) */
.exp-skill-container .control-cell.progress:only-child {
    grid-column: 1 / -1;
}

.exp-skill-container .control-cell .form-skill-button {
    width: 100%;
    height: 24px;
    border-radius: 6px;
}

.exp-skill-container .control-cell.progress .skill_progress_background,
.exp-skill-container .skill_progress_background {
    width: 100%;
    height: 24px;
    position: relative;
    flex: 1;
    min-width: 0;
}

.exp-skill-container .skill_progress_front {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
}

.exp-skill-container .scrolling-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.exp-skill-container .scrolling-text {
    position: absolute;
    white-space: nowrap;
    height: 100%;
    display: flex;
    align-items: center;
    animation: scroll-text 10s linear infinite;
}

@keyframes scroll-text {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

/* Skills container - column layout */
.experience-skills .skills-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.experience-skills .skills-dropdown.one-third {
    width: 100%;
    max-width: 300px;
}

/* Skills grid - 4 per row (3/12 each) */
.experience-skills .skills-grid,
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
    min-height: 24px;
}

/* Reset skill container to block display */
.experience-skills .exp-skill-container,
.exp-skill-container {
    display: block;
    width: 100%;
    min-height: 24px;
}

/* Style for add skill form */
.experience-skills .form-add-skill {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 300px;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
    .form-card .exp-card-header {
        flex-direction: column;
        gap: 8px;
    }
    
    .form-dates {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-separator {
        display: none;
    }
    
    .form-card .exp-card-body {
        display: block;
    }
    
    .experience-skills .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
