/**
 * Profile Page Styles - LinkedIn-style Design
 * Optimized for accessibility (WCAG 2.1 AA)
 */

/* ==========================================================================
   Profile Page Wrapper
   ========================================================================== */

.profile-page-wrapper {
    background: #f4f2ee;
    min-height: 100vh;
    padding-bottom: 3rem;
}

.profile-main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.profile-hero {
    position: relative;
    margin-bottom: 2rem;
}

.profile-cover {
    height: 200px;
    border-radius: 0 0 16px 16px;
    position: relative;
    overflow: hidden;
}

.profile-cover .cover-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.profile-hero-card {
    position: relative;
    margin-top: -60px;
    padding: 0 1rem;
}

/* Photo Section */
.profile-photo-wrapper {
    position: relative;
    display: inline-block;
}

.profile-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    background-color: #e9ecef;
    transition: transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.02);
}

/* Photo Placeholder for broken images */
.profile-photo-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.profile-photo-placeholder:hover {
    transform: scale(1.02);
}

.profile-photo-placeholder i {
    font-size: 4rem;
    color: #adb5bd;
}

.photo-edit-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--portal-color, #0d6efd);
    color: white;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.photo-edit-btn:hover,
.photo-edit-btn:focus {
    transform: scale(1.1);
    background: var(--portal-color-secondary, var(--portal-color, #0d6efd));
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Profile Info */
.profile-info {
    padding: 1rem 0;
}

.profile-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.profile-headline {
    font-size: 1rem;
    color: #495057;
    margin-bottom: 0.25rem;
}

.profile-location {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
}

.profile-location i {
    color: var(--portal-color, #0d6efd);
}

/* Profile Actions */
.profile-actions .btn {
    padding: 0.5rem 1rem;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.profile-actions .btn:focus {
    box-shadow: 0 0 0 3px rgba(var(--portal-color-rgb, 13, 110, 253), 0.25);
}

.profile-actions .btn-primary:hover {
    transform: translateY(-2px);
}

/* ==========================================================================
   Progress Section
   ========================================================================== */

.profile-progress-section {
    margin-bottom: 1.5rem;
}

.profile-progress-section .card {
    border-radius: 16px;
}

/* Progress Circle */
.progress-circle-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.progress-circle {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-circle .progress-bg {
    fill: none;
    stroke: #e9ecef;
    stroke-width: 8;
}

.progress-circle .progress-bar {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: calc(283 - (283 * var(--progress)) / 100);
    animation: progressAnimation 1.5s ease-out forwards;
}

@keyframes progressAnimation {
    from {
        stroke-dashoffset: 283;
    }
    to {
        stroke-dashoffset: calc(283 - (283 * var(--progress)) / 100);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .progress-circle .progress-bar {
        animation: none;
    }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.progress-percent {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6c757d;
}

/* Progress Info */
.progress-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
}

.progress-subtitle {
    font-size: 0.875rem;
}

/* Section Badges */
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.section-badge:focus {
    outline: 2px solid var(--portal-color, #0d6efd);
    outline-offset: 2px;
}

.section-badge.completed {
    background: #d4edda;
    color: #155724;
}

.section-badge.completed:hover,
.section-badge.completed:focus {
    background: #c3e6cb;
    transform: translateY(-2px);
}

.section-badge.pending {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px dashed #dee2e6;
}

.section-badge.pending:hover,
.section-badge.pending:focus {
    background: #e9ecef;
    border-color: var(--portal-color, #0d6efd);
    color: var(--portal-color, #0d6efd);
    transform: translateY(-2px);
}

.section-badge i:first-child {
    font-size: 0.875rem;
}

.section-badge .badge-check {
    font-size: 0.625rem;
    margin-left: 0.25rem;
}

/* ==========================================================================
   Profile Section Cards
   ========================================================================== */

.profile-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
    transition: box-shadow 0.3s ease;
}

.profile-section:hover {
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.1);
}

.profile-section .section-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-section .section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
    display: flex;
    align-items: center;
}

.profile-section .section-title i {
    margin-right: 0.75rem;
    color: var(--portal-color, #0d6efd);
}

.profile-section .section-body {
    padding: 1.25rem 1.5rem;
}

.profile-section .section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.profile-section .section-actions .btn {
    border-radius: 20px;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.profile-section .section-actions .btn:focus {
    box-shadow: 0 0 0 3px rgba(var(--portal-color-rgb, 13, 110, 253), 0.25);
}

/* ==========================================================================
   Timeline Items
   ========================================================================== */

.timeline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid #e9ecef;
    margin-left: 0.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
    border-left-color: transparent;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--portal-color, #0d6efd);
}

.timeline-item .item-company {
    font-weight: 600;
    font-size: 1rem;
    color: #212529;
}

.timeline-item .item-title {
    font-size: 0.95rem;
    color: #495057;
}

.timeline-item .item-meta {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.timeline-item .item-description {
    font-size: 0.9rem;
    color: #495057;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.timeline-item .item-actions {
    margin-top: 0.75rem;
}

.timeline-item .item-actions .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 15px;
}

.timeline-item .item-actions .btn:focus {
    box-shadow: 0 0 0 3px rgba(var(--portal-color-rgb, 13, 110, 253), 0.25);
}

/* ==========================================================================
   Skills Tags
   ========================================================================== */

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.2s ease;
}

.skill-badge:hover,
.skill-badge:focus {
    background: rgba(var(--portal-color-rgb, 13, 110, 253), 0.08);
    border-color: var(--portal-color, #0d6efd);
    color: var(--portal-color, #0d6efd);
}

.skill-badge:focus {
    outline: 2px solid var(--portal-color, #0d6efd);
    outline-offset: 2px;
}

.skill-badge .level {
    font-size: 0.7rem;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: #dee2e6;
    border-radius: 10px;
    color: #6c757d;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Preferences Section
   ========================================================================== */

.preference-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.preferences-grid .badge {
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.5em 0.85em;
}

/* ==========================================================================
   Tools Section
   ========================================================================== */

.profile-tools-section {
    margin-bottom: 1.5rem;
}

.profile-tools-section .card {
    border-radius: 16px;
    border: none;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.05);
}

.profile-tool-card {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    height: 100%;
}

.profile-tool-card:hover,
.profile-tool-card:focus {
    background: rgba(var(--portal-color-rgb, 13, 110, 253), 0.08);
    transform: translateY(-2px);
}

.profile-tool-card:focus {
    outline: 2px solid var(--portal-color, #0d6efd);
    outline-offset: 2px;
}

.profile-tool-card i {
    font-size: 2rem;
    color: var(--portal-color, #0d6efd);
    margin-bottom: 0.75rem;
    display: block;
}

.profile-tool-card .tool-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212529;
    margin-bottom: 0.25rem;
}

.profile-tool-card .tool-description {
    font-size: 0.75rem;
    color: #6c757d;
    margin: 0;
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    .profile-section {
        border: 2px solid #212529;
    }

    .timeline-item {
        border-left-width: 3px;
    }

    .skill-badge {
        border-width: 2px;
    }

    .section-badge.pending {
        border-style: solid;
        border-width: 2px;
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 767.98px) {
    .profile-page-wrapper {
        background: #fff;
    }

    .profile-main-content {
        padding: 0;
    }

    .profile-section {
        border-radius: 0;
        margin-bottom: 0.5rem;
    }

    .profile-section .section-header,
    .profile-section .section-body {
        padding: 1rem;
    }

    .timeline-item {
        padding-left: 1.5rem;
    }

    /* Hero Mobile */
    .profile-cover {
        height: 150px;
    }

    .profile-hero-card {
        margin-top: -50px;
        text-align: center;
    }

    .profile-photo,
    .profile-photo-placeholder {
        width: 120px;
        height: 120px;
    }

    .profile-photo-placeholder i {
        font-size: 3rem;
    }

    .photo-edit-btn {
        width: 32px;
        height: 32px;
        bottom: 5px;
        right: 5px;
    }

    .profile-info {
        text-align: center;
    }

    .profile-name {
        font-size: 1.5rem;
    }

    .profile-actions {
        justify-content: center !important;
    }

    /* Progress Mobile */
    .progress-circle-wrapper {
        width: 80px;
        height: 80px;
        margin: 0 auto 1rem;
    }

    .progress-number {
        font-size: 1.5rem;
    }

    .profile-progress-section .row {
        text-align: center;
    }

    .section-badges {
        justify-content: center;
    }

    .section-badge span {
        display: none;
    }

    .section-badge {
        padding: 0.5rem;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .section-badge .badge-check {
        position: absolute;
        bottom: -2px;
        right: -2px;
        background: #28a745;
        color: white;
        border-radius: 50%;
        width: 14px;
        height: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.5rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .profile-page-wrapper {
        background: white;
    }

    .profile-section {
        box-shadow: none;
        border: 1px solid #dee2e6;
        page-break-inside: avoid;
    }

    .profile-actions,
    .section-actions,
    .item-actions,
    .photo-edit-btn {
        display: none !important;
    }

    .timeline-item::before {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* ==========================================================================
   Skip Link (Accessibility)
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--portal-color, #0d6efd);
    color: white;
    padding: 8px 16px;
    z-index: 100;
    border-radius: 0 0 4px 0;
    text-decoration: none;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible for keyboard navigation */
.profile-section:focus-within {
    box-shadow: 0 0 0 2px var(--portal-color, #0d6efd), 0 4px 12px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Social Networks Section
   ========================================================================== */

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

.social-network-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.social-network-item:hover {
    background: #fff;
    border-color: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.social-network-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: white;
    flex-shrink: 0;
}

/* Social network brand colors */
.social-network-item--linkedin .social-network-icon {
    background: linear-gradient(135deg, #0077b5 0%, #005885 100%);
}

.social-network-item--github .social-network-icon {
    background: linear-gradient(135deg, #333 0%, #24292e 100%);
}

.social-network-item--instagram .social-network-icon {
    background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.social-network-item--twitter .social-network-icon {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8ddb 100%);
}

.social-network-item--website .social-network-icon {
    background: linear-gradient(135deg, var(--portal-color, #0d6efd) 0%, var(--portal-color-dark, #0b5ed7) 100%);
}

.social-network-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.social-network-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1a1a1a;
    line-height: 1.3;
}

.social-network-url {
    font-size: 0.8125rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.social-network-arrow {
    color: #adb5bd;
    font-size: 0.75rem;
    transition: transform 0.2s ease, color 0.2s ease;
}

.social-network-item:hover .social-network-arrow {
    color: var(--portal-color, #0d6efd);
    transform: translateX(2px);
}

/* Responsive */
@media (max-width: 575px) {
    .social-networks-grid {
        grid-template-columns: 1fr;
    }

    .social-network-item {
        padding: 0.75rem;
    }

    .social-network-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}
