/* Professional Profile Page Styles */

/* Profile Header */
.profile-header-modern {
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    overflow: hidden;
    position: relative;
}

.profile-cover {
    height: 200px;
    background: var(--gradient-primary);
    position: relative;
    overflow: hidden;
}

.profile-cover-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
}

.profile-info-section {
    padding: 2rem;
    position: relative;
    margin-top: -75px;
}

.profile-avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.profile-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    background: var(--bg-light);
    transition: var(--transition);
}

.profile-avatar-large:hover {
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.avatar-edit-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: 3px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    transition: var(--transition);
}

.avatar-edit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.profile-details {
    margin-top: 1rem;
}

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

.profile-username {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-fullname {
    font-size: 1.25rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.profile-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.rank-icon {
    font-size: 1.25rem;
}

.profile-bio {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    line-height: 1.8;
    color: var(--text-color);
}

.profile-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9375rem;
}

.meta-item svg {
    color: var(--primary-color);
}

.profile-actions {
    margin-top: 1.5rem;
}

/* Modern Profile Stats */
.profile-stats-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-modern {
    background: white;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.stat-card-modern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--gradient-soft);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 0;
}

.stat-card-modern:hover::before {
    opacity: 1;
}

.stat-card-modern:hover::after {
    width: 200px;
    height: 200px;
}

.stat-card-modern:hover {
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
    transform: translateY(-6px);
    border-color: rgba(102, 126, 234, 0.2);
}

.stat-icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: var(--transition);
}

.stat-card-modern:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.stat-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.stat-content h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.stat-card-modern:hover .stat-content h3 {
    transform: scale(1.05);
}

.stat-content p {
    color: var(--text-light);
    font-size: 0.9375rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Profile Content Grid */
.profile-content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.profile-main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Profile Sections */
.profile-section-modern {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.section-count {
    background: var(--gradient-soft);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

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

.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.activity-item:hover {
    background: var(--gradient-soft);
    border-left-color: var(--primary-color);
    transform: translateX(4px);
}

.activity-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.activity-type {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.activity-date {
    color: var(--text-light);
    font-size: 0.8125rem;
}

.activity-text {
    color: var(--text-color);
}

.activity-text a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.activity-text a:hover {
    color: var(--primary-color);
}

/* Compact Question/Answer Lists */
.questions-list-compact,
.answers-list-compact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-item-compact,
.answer-item-compact {
    padding: 1.25rem;
    background: var(--bg-light);
    border-radius: 12px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.question-item-compact:hover,
.answer-item-compact:hover {
    background: white;
    border-color: rgba(102, 126, 234, 0.2);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.question-item-header,
.answer-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-badge-small {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
}

.question-date-small,
.answer-date-small {
    color: var(--text-light);
    font-size: 0.8125rem;
}

.question-title-compact {
    margin-bottom: 0.75rem;
}

.question-title-compact a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 600;
    transition: var(--transition);
    display: block;
}

.question-title-compact a:hover {
    color: var(--primary-color);
}

.question-stats-compact,
.answer-stats-compact {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.stat-compact {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-light);
    font-size: 0.8125rem;
}

.stat-compact svg {
    opacity: 0.7;
}

.answer-question-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.answer-question-link:hover {
    color: var(--primary-color);
}

.answer-content-compact {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.best-answer-badge-small {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Profile Widgets */
.profile-widget {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.profile-widget h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-widget h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Point History */
.point-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.point-history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 10px;
    transition: var(--transition);
}

.point-history-item:hover {
    background: var(--gradient-soft);
    transform: translateX(4px);
}

.point-change {
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.point-change.positive {
    color: var(--success-color);
}

.point-change.negative {
    color: var(--danger-color);
}

.point-details {
    flex: 1;
}

.point-action {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.point-date {
    color: var(--text-light);
    font-size: 0.75rem;
}

/* Modern Achievements System */
.achievements-widget {
    position: relative;
}

.achievements-section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.achievements-section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* No Achievements State */
.no-achievements-state {
    text-align: center;
    padding: 2rem 1rem;
}

.no-achievements-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.no-achievements-text {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.no-achievements-hint {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.achievement-badge {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.achievement-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.achievement-badge.unlocked::before {
    opacity: 1;
}

.achievement-badge.unlocked {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.achievement-badge:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.achievement-badge[data-rarity="legendary"] {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
}

.achievement-badge[data-rarity="epic"] {
    border-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
}

.achievement-badge[data-rarity="rare"] {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
}

.achievement-badge[data-rarity="uncommon"] {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.achievement-icon-large {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 0.75rem;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    transition: var(--transition);
}

.achievement-badge:hover .achievement-icon-large {
    transform: scale(1.1) rotate(5deg);
}

.achievement-name {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.achievement-rarity {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.achievement-date {
    font-size: 0.75rem;
    color: var(--text-light);
    font-style: italic;
}

/* Achievements Progress */
.achievements-progress {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--bg-light);
}

.achievement-category-section {
    margin-bottom: 1.5rem;
}

.category-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.achievements-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.achievement-progress-item {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid transparent;
    transition: var(--transition);
}

.achievement-progress-item.unlocked {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.05));
    border-color: var(--primary-color);
}

.achievement-progress-item:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.progress-item-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.progress-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.progress-name {
    flex: 1;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-color);
}

.progress-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.unlocked-badge {
    background: var(--gradient-primary);
    color: white;
}

.progress-bar-container {
    height: 8px;
    background: var(--bg-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.progress-percentage {
    color: var(--primary-color);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .achievement-icon-large {
        font-size: 2.5rem;
    }
    
    .achievement-name {
        font-size: 0.8125rem;
    }
}

/* Profile Edit */
.profile-edit-container {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    margin: 0 auto;
}

.edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--bg-light);
}

.edit-header h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.form-section {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.form-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.8125rem;
}

.avatar-edit-section {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.current-avatar {
    flex-shrink: 0;
}

.current-avatar img {
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.avatar-upload-controls {
    flex: 1;
    min-width: 200px;
}

.avatar-upload-controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    background: white;
    border-radius: 10px;
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--bg-light);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 2px solid var(--bg-light);
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--text-light);
}

/* Responsive */
@media (max-width: 968px) {
    .profile-content-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-stats-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .profile-header-modern {
        border-radius: 16px;
    }
    
    .profile-info-section {
        padding: 1.5rem;
        margin-top: -60px;
    }
    
    .profile-avatar-large {
        width: 120px;
        height: 120px;
    }
    
    .profile-username {
        font-size: 2rem;
    }
    
    .profile-stats-modern {
        grid-template-columns: 1fr;
    }
    
    .profile-edit-container {
        padding: 1.5rem;
    }
    
    .edit-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .avatar-edit-section {
        flex-direction: column;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

