/*
 * Profile Views Specific Styles
 * CSS riêng cho các trang profile (xem, chỉnh sửa)
 */

/* ========================================
   PROFILE HEADER
   ======================================== */

.profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.profile-content {
    position: relative;
    z-index: 1;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
}

.profile-details h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}

.profile-username {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* ========================================
   PROFILE NAVIGATION
   ======================================== */

.profile-nav {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    margin-bottom: 2rem;
}

.nav-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-tab {
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========================================
   PROFILE CONTENT SECTIONS
   ======================================== */

.profile-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-action {
    font-size: 0.875rem;
}

/* About Section */
.profile-bio {
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.profile-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
}

.detail-icon {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.detail-text {
    flex: 1;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Activity Section */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border-left: 3px solid var(--primary-color);
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.activity-meta {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Threads Section */
.thread-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.thread-item-profile {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.thread-item-profile:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.thread-info {
    flex: 1;
}

.thread-title-profile {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.thread-title-profile a {
    color: var(--text-primary);
    text-decoration: none;
}

.thread-title-profile a:hover {
    color: var(--primary-color);
}

.thread-excerpt-profile {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.thread-meta-profile {
    font-size: 0.875rem;
    color: var(--text-secondary);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.thread-stats-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
}

.thread-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   PROFILE EDIT FORM
   ======================================== */

.profile-edit-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.avatar-upload {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.privacy-settings {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.privacy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
}

.privacy-label {
    font-weight: 500;
    color: var(--text-primary);
}

.privacy-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .profile-info {
        text-align: center;
        flex-direction: column;
    }

    .profile-stats {
        justify-content: center;
        width: 100%;
    }

    .nav-tabs {
        justify-content: center;
    }

    .profile-section {
        padding: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

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

    .activity-item {
        flex-direction: column;
        text-align: center;
    }

    .thread-item-profile {
        flex-direction: column;
        gap: 1rem;
    }

    .thread-stats-profile {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .avatar-upload {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .profile-header {
        padding: 1.5rem 0;
    }

    .profile-details h1 {
        font-size: 1.5rem;
    }

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

    .profile-section {
        padding: 1rem;
    }

    .profile-edit-container {
        padding: 1rem;
    }

    .nav-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   DARK MODE OVERRIDES
   ======================================== */

[data-theme="dark"] .profile-nav,
[data-theme="dark"] .profile-section,
[data-theme="dark"] .profile-edit-container {
    background: var(--dark-bg-secondary);
    border-color: var(--dark-border-color);
}

[data-theme="dark"] .detail-item,
[data-theme="dark"] .activity-item,
[data-theme="dark"] .thread-item-profile,
[data-theme="dark"] .privacy-item {
    background: var(--dark-bg-tertiary);
    border-color: var(--dark-border-color);
}

[data-theme="dark"] .nav-tab:hover {
    background: var(--dark-bg-tertiary);
}
