/* القسم السابع — Language proficiency matrix (responsive cards) */

.lang-matrix-intro {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, rgba(255, 255, 255, 1) 100%);
    border: 1px solid rgba(31, 113, 202, 0.12);
    border-right: 3px solid #1f71ca;
    border-radius: 0.875rem;
    padding: 1rem 1.125rem;
    margin-bottom: 1rem;
}

.lang-level-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.75rem;
}

.lang-level-legend span {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.lang-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    font-size: 0.75rem;
    color: #64748b;
}

.lang-progress-bar {
    flex: 1;
    height: 0.375rem;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}

.lang-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1f71ca, #204b87);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

.lang-matrix {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lang-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.875rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lang-card.is-complete {
    border-color: rgba(34, 197, 94, 0.35);
}

.lang-card.lang-card-missing {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.15) !important;
}

.lang-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.lang-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, #1f71ca 0%, #204b87 100%);
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

.lang-card--other .lang-card-icon {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.lang-card-title {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.lang-card-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    background: #dcfce7;
    color: #15803d;
    flex-shrink: 0;
}

.lang-card-badge.is-pending {
    background: #fef3c7;
    color: #b45309;
}

.lang-other-name {
    width: 100%;
    margin-top: 0.375rem;
}

.lang-skills {
    padding: 0.875rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lang-skill {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lang-skill-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
}

.lang-skill-label i {
    width: 1.25rem;
    text-align: center;
    color: #1f71ca;
    font-size: 0.875rem;
}

.lang-level-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem;
}

@media (min-width: 400px) {
    .lang-level-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 640px) {
    .lang-level-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
}

.lang-level-option {
    display: block;
    cursor: pointer;
    margin: 0;
}

.lang-level-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.lang-level-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.5rem 0.375rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 0.625rem;
    background: #f8fafc;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    line-height: 1.25;
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.15s ease;
}

@media (min-width: 640px) {
    .lang-level-inner {
        font-size: 0.75rem;
        min-height: 2.75rem;
    }
}

.lang-level-option:hover .lang-level-inner {
    border-color: rgba(31, 113, 202, 0.35);
    background: #f0f7ff;
    color: #1f71ca;
}

.lang-level-option input:focus-visible + .lang-level-inner {
    outline: 2px solid #1f71ca;
    outline-offset: 2px;
}

.lang-level-option input:checked + .lang-level-inner {
    border-color: #1f71ca;
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    box-shadow: 0 2px 6px rgba(31, 113, 202, 0.12);
    transform: translateY(-1px);
}

.lang-level-option--excellent input:checked + .lang-level-inner {
    border-color: #059669;
    background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
}

.lang-level-option--very_good input:checked + .lang-level-inner {
    border-color: #0284c7;
    background: linear-gradient(180deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0369a1;
}

.lang-level-option--weak input:checked + .lang-level-inner {
    border-color: #94a3b8;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    color: #64748b;
}

.lang-skill.lang-skill-missing .lang-skill-label {
    color: #dc2626;
}

@media (prefers-reduced-motion: reduce) {
    .lang-level-inner,
    .lang-progress-fill {
        transition: none !important;
    }
}
