/* Profile Page Styles - Reddit.com Inspired */
.profile-container {
    width: 100%;
    margin: 0;
    padding: 1rem;
    background: var(--color-background);
}

/* Profile Header - Reddit Style */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4500 0%, #ff6b35 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: bold;
    color: white;
    border: 3px solid #ff4500;
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.3);
}

.profile-info {
    flex: 1;
}

.profile-username {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.profile-email {
    font-size: 0.9rem;
    color: var(--color-text-meta);
    margin-bottom: 0.5rem;
}

.profile-provider {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #ff4500;
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Stats Grid - Reddit Card Style */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff4500, #ff6b35);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #ff4500;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #ff4500;
    margin-bottom: 0.25rem;
    transition: color 0.2s ease;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-meta);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Engagement Chart - Reddit Style */
.engagement-chart {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.section-title::before {
    content: '';
    width: 4px;
    height: 1.125rem;
    background: #ff4500;
    border-radius: 2px;
}

.chart-container {
    height: 200px;
    display: flex;
    align-items: end;
    gap: 0.75rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, #ff4500, #ff6b35);
    border-radius: 4px 4px 0 0;
    min-height: 20px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.chart-bar:hover {
    background: linear-gradient(to top, #ff6b35, #ff8c69);
    transform: scaleY(1.05);
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.3);
}

.chart-bar--upvoted-articles {
    background: linear-gradient(to top, #ff4500, #ff6b35);
}

.chart-bar--downvoted-articles {
    background: linear-gradient(to top, #7193ff, #9bb1ff);
}

.chart-bar--comments {
    background: linear-gradient(to top, #46d160, #6bdd7a);
}

.chart-bar--upvoted-comments {
    background: linear-gradient(to top, #ff4500, #ff6b35);
}

.chart-bar--downvoted-comments {
    background: linear-gradient(to top, #7193ff, #9bb1ff);
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.chart-label {
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-meta);
    font-weight: 500;
    flex: 1;
}

.chart-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-text);
    background: var(--color-surface);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    white-space: nowrap;
}

/* Profile Sections - Reddit Layout */
.profile-sections {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.profile-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Activity Timeline - Reddit Style */
.activity-timeline {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color 0.2s ease;
    cursor: pointer;
    border-radius: 4px;
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.activity-item:hover {
    background-color: var(--color-background);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.activity-icon.comment {
    background: #46d160;
    color: white;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--color-text);
    margin-bottom: 0.25rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.activity-meta {
    font-size: 0.75rem;
    color: var(--color-text-meta);
}

/* Quick Stats - Reddit Style */
.quick-stats {
    margin-bottom: 1.5rem;
}

.quick-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

.quick-stat:last-child {
    border-bottom: none;
}

.quick-stat-label {
    font-size: 0.875rem;
    color: var(--color-text-meta);
}

.quick-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

/* Quick Actions - Reddit Button Style */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
}

.action-btn--primary {
    background: #ff4500;
    color: white;
}

.action-btn--primary:hover {
    background: #e03d00;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 69, 0, 0.3);
}

.action-btn--secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.action-btn--secondary:hover {
    background: var(--color-background);
    border-color: #ff4500;
    color: #ff4500;
}

.action-btn--danger {
    background: #ff4444;
    color: white;
}

.action-btn--danger:hover {
    background: #e03d3d;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
}

/* Empty State - Reddit Style */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.empty-state-subtext {
    font-size: 0.875rem;
    color: var(--color-text-meta);
    margin-bottom: 2rem;
}

/* Responsive Design */
@media (max-width: 767px) {
    .profile-container {
        padding: 0.5rem;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .profile-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .profile-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-labels {
        flex-direction: column;
        gap: 0.5rem;
    }

    .chart-label {
        text-align: left;
        font-size: 0.7rem;
    }

    .quick-actions {
        flex-direction: column;
    }

    .action-btn {
        min-height: 44px;
        /* Ensure touch target */
        padding: 10px 16px;
    }

    /* Ensure activity items are clickable */
    .activity-item {
        padding: 12px 6px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

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

    .profile-username {
        font-size: 1.25rem;
    }

    .chart-container {
        height: 150px;
        gap: 0.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .profile-header {
        background: var(--color-surface);
        border-color: var(--color-border);
    }

    .stat-card {
        background: var(--color-surface);
        border-color: var(--color-border);
    }

    .profile-section {
        background: var(--color-surface);
        border-color: var(--color-border);
    }

    .engagement-chart {
        background: var(--color-surface);
        border-color: var(--color-border);
    }
}

/* Animations */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    animation: countUp 0.6s ease-out forwards;
    opacity: 0;
}

.stat-card:nth-child(1) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.3s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Loading States */
.profile-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top: 3px solid #ff4500;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* State Classes for JS Interaction */
.profile-card--hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #ff4500;
}

.profile-card--hover::before {
    transform: scaleX(1);
}

.profile-item--hidden {
    opacity: 0;
    transform: translateX(-20px);
}

.profile-item--visible {
    opacity: 1;
    transform: translateX(0);
    transition: all 0.5s ease;
}

.chart-bar--active {
    transform: scaleY(1.05);
    box-shadow: 0 4px 12px rgba(255, 69, 0, 0.4);
    filter: brightness(1.1);
}

/* Modal and Tooltip Additions */
.chart-tooltip {
    position: fixed;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.75rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 2000;
    pointer-events: none;
    animation: tooltipFade 0.2s ease-out;
}

@keyframes tooltipFade {
    from {
        opacity: 0;
        transform: translate(-50%, -90%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -100%);
    }
}

.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
}

.profile-modal {
    background: var(--color-surface);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: modalSlide 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.profile-modal-header {
    background: var(--color-background);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.profile-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #ff4500;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--color-text-meta);
    cursor: pointer;
    line-height: 1;
}

.profile-modal-body {
    padding: 1.5rem;
    color: var(--color-text);
}