/* ==========================================================================
   incuCommunity - Profile Page
   ========================================================================== */

/* Hero Section */
.incuc-profile-hero {
    position: relative;
    margin-bottom: 0;
}

.incuc-profile-cover {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.incuc-profile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.incuc-profile-header {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 24px 20px;
    margin-top: -48px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.incuc-profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
}

.incuc-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.incuc-profile-info {
    flex: 1;
    min-width: 0;
    padding-bottom: 4px;
}

.incuc-profile-name {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 4px;
    line-height: 1.2;
}

.incuc-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
}

.incuc-profile-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.incuc-profile-meta-item i {
    font-size: 14px;
}

/* Profile Tabs */
.incuc-profile-tabs {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    width: 100%;
}

.incuc-profile-tabs-nav {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.incuc-profile-tabs-nav::-webkit-scrollbar {
    display: none;
}

.incuc-profile-tab-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 150ms ease, border-color 150ms ease;
    cursor: pointer;
}

.incuc-profile-tab-link:hover {
    color: #374151;
}

.incuc-profile-tab-link.is-active {
    color: #6366f1;
    border-bottom-color: #6366f1;
    font-weight: 600;
}

.incuc-profile-tab-icon {
    font-size: 16px;
}

.incuc-profile-tab-link.is-active .incuc-profile-tab-icon {
    color: #6366f1;
}

/* Tab Content */
.incuc-profile-tabs-content {
    min-height: 400px;
    padding: 24px;
}

.incuc-profile-tab-pane {
    display: none;
}

.incuc-profile-tab-pane.is-active {
    display: block;
}

.incuc-profile-tab-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #9ca3af;
    font-size: 14px;
}

/* Activity Tab */
.incuc-profile-activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.incuc-profile-activity-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* Info Tab (read-only view — used in public profile) */
.incuc-profile-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.incuc-profile-field-group {
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

.incuc-profile-field-group:last-child {
    border-bottom: none;
}

.incuc-profile-field-group-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.incuc-profile-field-row {
    display: flex;
    padding: 8px 0;
    font-size: 14px;
}

.incuc-profile-field-label {
    width: 160px;
    flex-shrink: 0;
    color: #6b7280;
    font-weight: 500;
}

.incuc-profile-field-value {
    flex: 1;
    color: #111827;
}

.incuc-profile-tax-group {
    transition: opacity 200ms ease;
}

/* Edit Profile Tab */
.incuc-profile-edit-form {
    max-width: 100%;
}

.incuc-profile-form-group {
    margin-bottom: 20px;
}

.incuc-profile-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.incuc-profile-form-input,
.incuc-profile-form-textarea,
.incuc-profile-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    transition: border-color 150ms ease;
}

.incuc-profile-form-input:focus,
.incuc-profile-form-textarea:focus,
.incuc-profile-form-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.incuc-profile-form-input:disabled,
.incuc-profile-form-select:disabled {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

.incuc-profile-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.incuc-profile-form-actions {
    display: flex;
    gap: 12px;
    padding-top: 8px;
}

.incuc-profile-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: background-color 150ms ease, opacity 150ms ease;
}

.incuc-profile-btn--primary {
    background: #6366f1;
    color: #fff;
}

.incuc-profile-btn--primary:hover {
    background: #4f46e5;
}

.incuc-profile-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.incuc-profile-btn--secondary {
    background: #f3f4f6;
    color: #374151;
}

.incuc-profile-btn--secondary:hover {
    background: #e5e7eb;
}

/* Points Tab */
.incuc-points-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.incuc-points-kpi {
    background: #f9fafb;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.incuc-points-kpi--wide {
    grid-column: 1 / -1;
    text-align: left;
}

.incuc-points-kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: #6366f1;
    line-height: 1.1;
    margin-bottom: 4px;
}

.incuc-points-kpi-rank {
    font-size: 22px;
}

.incuc-points-kpi-label {
    font-size: 13px;
    color: #6b7280;
}

.incuc-points-kpi-label strong {
    color: #374151;
}

.incuc-points-progress {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0 6px;
}

.incuc-points-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 5px;
    transition: width 500ms ease;
}

.incuc-points-progress-text {
    font-size: 12px;
    color: #6b7280;
}

.incuc-points-history {
    margin-top: 8px;
}

.incuc-points-history-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px;
}

.incuc-points-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.incuc-points-table thead th {
    text-align: left;
    font-weight: 600;
    color: #374151;
    padding: 10px 12px;
    border-bottom: 2px solid #e5e7eb;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.incuc-points-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
}

.incuc-points-table tbody tr:hover {
    background: #f9fafb;
}

.incuc-points-table td {
    padding: 12px;
    color: #374151;
}

.incuc-points-date {
    white-space: nowrap;
    color: #9ca3af;
    font-size: 13px;
    width: 120px;
}

.incuc-points-desc {
    color: #374151;
}

.incuc-points-amount {
    font-weight: 600;
    white-space: nowrap;
    text-align: right;
    width: 80px;
}

.incuc-points-amount.positive {
    color: #10b981;
}

.incuc-points-amount.negative {
    color: #ef4444;
}

.incuc-points-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px 0 4px;
}

.incuc-points-page-info {
    font-size: 13px;
    color: #6b7280;
}

/* Friends Tab */
.incuc-profile-friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.incuc-profile-friend-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    background: #f9fafb;
    text-decoration: none;
    color: inherit;
    transition: background-color 150ms ease;
}

.incuc-profile-friend-card:hover {
    background: #f3f4f6;
}

.incuc-profile-friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.incuc-profile-friend-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.incuc-profile-friend-type {
    font-size: 12px;
    color: #6b7280;
}

/* Groups Tab */
.incuc-profile-groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.incuc-profile-group-card {
    border-radius: 10px;
    background: #f9fafb;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 150ms ease;
}

.incuc-profile-group-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.incuc-profile-group-cover {
    height: 80px;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
}

.incuc-profile-group-body {
    padding: 12px 16px;
}

.incuc-profile-group-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.incuc-profile-group-meta {
    font-size: 12px;
    color: #6b7280;
}

/* Courses Tab */
.incuc-profile-courses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.incuc-profile-course-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 10px;
    background: #f9fafb;
    text-decoration: none;
    color: inherit;
}

.incuc-profile-course-card:hover {
    background: #f3f4f6;
}

.incuc-profile-course-info {
    flex: 1;
    min-width: 0;
}

.incuc-profile-course-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.incuc-profile-course-progress {
    display: flex;
    align-items: center;
    gap: 8px;
}

.incuc-profile-course-bar {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.incuc-profile-course-bar-fill {
    height: 100%;
    background: #6366f1;
    border-radius: 3px;
    transition: width 300ms ease;
}

.incuc-profile-course-percent {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

/* Toast */
.incuc-profile-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    background: #111827;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 200ms ease, transform 200ms ease;
}

.incuc-profile-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.incuc-profile-toast.is-success {
    background: #059669;
}

.incuc-profile-toast.is-error {
    background: #dc2626;
}

/* Empty states */
.incuc-profile-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
}

.incuc-profile-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

/* Avatar/Cover upload overlay */
.incuc-profile-avatar-upload {
    position: relative;
    cursor: pointer;
}

.incuc-profile-avatar-upload:hover .incuc-profile-avatar-overlay {
    opacity: 1;
}

.incuc-profile-avatar-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 150ms ease;
}

.incuc-profile-avatar-overlay i {
    color: #fff;
    font-size: 20px;
}

.incuc-profile-cover-upload {
    position: relative;
    cursor: pointer;
}

.incuc-profile-cover-upload:hover .incuc-profile-cover-overlay {
    opacity: 1;
}

.incuc-profile-cover-overlay {
    position: absolute;
    inset: 0;
    border-radius: 12px 12px 0 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 150ms ease;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.incuc-profile-cover-overlay i {
    color: #fff;
    font-size: 18px;
}

.incuc-profile-upload-input {
    display: none;
}

.incuc-profile-uploading {
    pointer-events: none;
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
    .incuc-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -48px;
        padding: 0 16px 16px;
    }

    .incuc-profile-avatar {
        width: 80px;
        height: 80px;
    }

    .incuc-profile-name {
        font-size: 20px;
    }

    .incuc-profile-meta {
        justify-content: center;
    }

    .incuc-profile-tabs-content {
        padding: 16px;
    }

    .incuc-profile-tab-link {
        padding: 12px 14px;
        font-size: 13px;
    }

    .incuc-profile-tab-label {
        display: none;
    }

    .incuc-profile-tab-icon {
        font-size: 18px;
    }

    .incuc-profile-tab-link.is-active .incuc-profile-tab-label {
        display: inline;
    }

    .incuc-profile-field-row {
        flex-direction: column;
        gap: 2px;
    }

    .incuc-profile-field-label {
        width: auto;
    }

    .incuc-profile-friends-grid {
        grid-template-columns: 1fr;
    }

    .incuc-profile-groups-grid {
        grid-template-columns: 1fr;
    }
}
