/* User Profile Styles */

:root {
    --card-background: #161b22;
    --border-color: #21262d;
    --text-primary: #ffffff;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --primary-color: #2196f3;
    --dark-color: #000000;
    --background-light: #161b22;
    --info-color: #03a9f4;
}

.profile-header {
    background: var(--card-background);
    padding: 2em;
    border-radius: 8px;
    margin-bottom: 2em;
    border: 1px solid var(--border-color);
}

.profile-info {
    display: flex;
    gap: 1.5em;
    align-items: flex-start;
}

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

.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--dark-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
}

.profile-details h1 {
    margin: 0 0 0.5em 0;
    color: var(--text-primary);
}

.profile-bio {
    color: var(--text-secondary);
    margin-bottom: 1em;
    line-height: 1.5;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin-bottom: 1em;
}

.meta-item {
    color: var(--text-muted);
    font-size: 0.9em;
}

.meta-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.meta-item a:hover {
    text-decoration: underline;
}

.profile-actions {
    margin-top: 1em;
}

.admin-actions {
    margin-top: 1.5em;
    padding: 1em;
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid var(--warning-color);
    border-radius: 5px;
}

.admin-actions h4 {
    margin: 0 0 0.5em 0;
    color: var(--warning-color);
    font-size: 0.9em;
    text-transform: uppercase;
    font-weight: 600;
}

.admin-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.admin-buttons .btn-small {
    padding: 0.4em 0.8em;
    font-size: 0.8em;
}

.profile-content {
    display: grid;
    gap: 2em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1em;
    margin-top: 1em;
}

.stat-card {
    text-align: center;
    padding: 1em;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: 0.5em;
}

.recent-posts h3 {
    margin-bottom: 1em;
    color: var(--text-primary);
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
}

.post-item {
    padding: 0.75em 0;
    border-bottom: 1px solid var(--border-color);
}

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

.post-item h4 {
    margin: 0 0 0.25em 0;
}

.post-item h4 a {
    color: var(--text-primary);
    text-decoration: none;
}

.post-item h4 a:hover {
    color: var(--primary-color);
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Profile Edit Form Styles */
.profile-edit-form {
    max-width: 600px;
    background: var(--card-background);
    padding: 2em;
    border-radius: 8px;
    margin-bottom: 2em;
    border: 1px solid var(--border-color);
}

.profile-edit-form .form-group {
    margin-bottom: 1.5em;
}

.profile-edit-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: var(--text-primary);
}

.profile-edit-form input,
.profile-edit-form textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    background-color: var(--background-light);
    color: var(--text-primary);
}

.profile-edit-form input:focus,
.profile-edit-form textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 188, 212, 0.25);
}

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

.profile-edit-form .btn-group {
    display: flex;
    gap: 1em;
    justify-content: flex-start;
}

.profile-edit-form small {
    display: block;
    margin-top: 0.25em;
    color: var(--text-muted);
    font-size: 0.9em;
}

/* Account Info Styles */
.account-info {
    background: var(--card-background);
    padding: 1.5em;
    border-radius: 8px;
    max-width: 600px;
    border: 1px solid var(--border-color);
}

.account-info h3 {
    margin: 0 0 1em 0;
    color: var(--text-primary);
}

.info-grid {
    display: grid;
    gap: 0.75em;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.status-active {
    color: var(--success-color);
    font-weight: bold;
}

.status-inactive {
    color: var(--danger-color);
    font-weight: bold;
}

.role-admin {
    background: var(--primary-color);
    color: var(--dark-color);
    padding: 0.2em 0.5em;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
}

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

    .profile-avatar,
    .profile-avatar-placeholder {
        align-self: center;
        margin: 0 auto 1rem auto;
    }

    .profile-details {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-meta {
        justify-content: center;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

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

    .profile-edit-form {
        padding: 1em;
    }

    .profile-edit-form .btn-group {
        flex-direction: column;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25em;
    }
}

/* Discord-Managed Fields Styles */
.discord-managed-info {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5em;
    margin-bottom: 2em;
}

.discord-managed-info h3 {
    margin-top: 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.discord-managed-info h3::before {
    content: "🔒";
    font-size: 0.9em;
}

.info-text {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid var(--info-color);
    border-radius: 4px;
    padding: 1em;
    margin-bottom: 1.5em;
    color: var(--info-color);
    font-size: 0.9em;
    line-height: 1.4;
}

.readonly-fields {
    display: grid;
    gap: 1em;
}

.form-group.readonly {
    opacity: 0.8;
}

.form-control.readonly {
    background-color: var(--background-light);
    border-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-control.readonly:focus {
    box-shadow: none;
    border-color: var(--border-color);
}

.avatar-display {
    display: flex;
    align-items: center;
    gap: 1em;
}

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

.avatar-display small {
    color: var(--text-muted);
}

/* Solved Challenges Section */
.solved-challenges {
    margin-top: 2em;
}

.solved-challenges h3 {
    margin-bottom: 1em;
    color: var(--text-primary);
}

.challenges-list {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.challenge-item {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5em;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 1px 3px rgba(0, 188, 212, 0.1);
    transition: box-shadow 0.2s ease;
}

.challenge-item:hover {
    box-shadow: 0 2px 6px rgba(0, 188, 212, 0.2);
    border-color: var(--primary-color);
}

.challenge-info h4 {
    margin: 0 0 0.5em 0;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
}

.challenge-info p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

.challenge-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25em;
    text-align: right;
}

.challenge-points {
    background: var(--success-color);
    color: white;
    padding: 0.25em 0.5em;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.875em;
}

.challenge-rank {
    color: var(--warning-color);
    font-weight: bold;
    font-size: 0.875em;
}

.challenge-time {
    color: var(--text-muted);
    font-size: 0.8em;
}

@media (max-width: 768px) {
    .challenge-item {
        flex-direction: column;
        gap: 1em;
    }

    .challenge-details {
        align-items: flex-start;
        text-align: left;
    }
}

/* Additional mobile improvements for very small screens */
@media (max-width: 480px) {
    .profile-header {
        padding: 1.5em;
        margin-bottom: 1.5em;
    }

    .profile-avatar,
    .profile-avatar-placeholder {
        width: 80px;
        height: 80px;
        font-size: 1.5em;
    }

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

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

    .admin-actions {
        padding: 0.75em;
        margin-top: 1em;
    }

    .admin-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

    .admin-buttons .btn {
        width: 100%;
        text-align: center;
    }
}
