/* Profile Page Specific Styles */

/* Profile Header (from user.html style) */
.profile-header {
    background: var(--bg-card);
    border-radius: 0 0 20px 20px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    border-top: none;
}

.profile-cover {
    height: 150px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 0 0 20px 20px;
}

.profile-content {
    padding: 0 30px 30px;
}

.profile-main {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    margin-top: -60px;
}

.avatar-container {
    position: relative;
    flex-shrink: 0;
}

.author-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--bg-card);
    box-shadow: 0 5px 20px var(--shadow-color);
}

.edit-avatar-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    border: 3px solid var(--bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-avatar-btn:hover {
    transform: scale(1.1);
    background: var(--accent-secondary);
}

.user-info {
    flex: 1;
    padding-top: 70px;
}

.user-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
}

.author-name {
    margin: 0;
    font-size: 2em;
    color: var(--text-primary);
}

.profile-actions {
    display: flex;
    gap: 10px;
}

.share-profile-btn,
.edit-profile-btn {
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-profile-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.share-profile-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.edit-profile-btn {
    background: var(--accent-primary);
    border: 2px solid var(--accent-primary);
    color: white;
}

.edit-profile-btn:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.author-followers {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* Level Badge */
.level-badge-container {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    background: var(--bg-secondary);
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    margin: 10px 0;
}

.level-badge-container:hover .level-details-popover {
    display: block;
}

.level-icon {
    font-size: 1.3em;
    color: var(--accent-primary);
}

.level-name {
    font-weight: 600;
    color: var(--text-primary);
}

.level-details-popover {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    min-width: 250px;
    z-index: 1000;
    box-shadow: 0 10px 30px var(--shadow-color);
    margin-top: 10px;
}

.level-details-popover h4 {
    margin: 0 0 15px;
    color: var(--text-primary);
}

.level-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 5px;
}

.level-list-item.active {
    background: var(--bg-hover);
}

.level-list-item:hover {
    background: var(--bg-secondary);
}

.level-list-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
}

.level-progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Badges Section */
.badges-section {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.badge-item {
    text-align: center;
    width: 60px;
    cursor: help;
}

.badge-item > div:first-child {
    font-size: 1.5em;
    color: var(--accent-primary);
    background: var(--bg-secondary);
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.badge-item > div:last-child {
    font-size: 0.7em;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.user-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.user-badges .badge {
    background: var(--accent-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    text-transform: uppercase;
    font-weight: bold;
}

.user-badges .badge:last-child {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

#upgradeLink {
    font-size: 0.8em;
    margin-left: 10px;
    color: var(--accent-primary);
    text-decoration: none;
}

#upgradeLink:hover {
    text-decoration: underline;
}

/* Status Field */
.status-field {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
}

.status-input {
    text-align: center;
    max-width: 400px;
    padding: 8px 15px;
    border-radius: 20px;
    border: 2px dashed var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.status-input:focus {
    outline: none;
    border-style: solid;
    border-color: var(--accent-primary);
}

.edit-btn-inline {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: all 0.2s ease;
}

.edit-btn-inline:hover {
    color: var(--accent-primary);
}

/* User Stats */
.user-stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.user-stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85em;
    color: var(--text-secondary);
}

/* Container */
.profile-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Tab Navigation */
.profile-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    background: var(--bg-card);
    padding: 10px;
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.profile-tabs .tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.profile-tabs .tab-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.profile-tabs .tab-btn.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Profile Section */
.profile-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.section-title {
    margin: 0 0 10px;
    font-size: 1.4em;
    color: var(--text-primary);
}

.section-description {
    margin: 0 0 25px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Field Rows */
.field-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.field-row:last-child {
    margin-bottom: 0;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-group.full-width {
    grid-column: 1 / -1;
}

/* Field Label */
.field-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.field-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.field-name i {
    margin-right: 8px;
    color: var(--accent-primary);
}

/* Visibility Toggle */
.visibility-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.visibility-toggle:hover {
    background: var(--bg-hover);
}

.visibility-toggle i {
    font-size: 0.9em;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.visibility-toggle i.fa-globe {
    color: var(--success);
}

.visibility-toggle i.fa-lock {
    color: var(--warning);
}

/* Field Input Wrapper */
.field-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.field-input {
    flex: 1;
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.field-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.field-input:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Edit Button */
.edit-btn {
    padding: 10px 15px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.edit-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.edit-btn.saving {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

/* Visibility Badge */
.visibility-badge {
    margin-top: 5px;
    padding: 3px 10px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 0.75em;
    color: var(--text-secondary);
    width: fit-content;
}

.visibility-badge.public {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.visibility-badge.private {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    margin-top: 20px;
}

.info-box i {
    font-size: 1.5em;
    color: var(--info);
    flex-shrink: 0;
}

.info-box p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.5;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding: 20px 0;
}

.profile-actions .btn-primary,
.profile-actions .btn-secondary {
    padding: 15px 40px;
    font-size: 1.1em;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
    border: 1px solid var(--border-color);
    z-index: 4000;
    transform: translateX(150%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.success i {
    color: var(--success);
}

.toast.error {
    border-left: 4px solid var(--danger);
}

.toast.error i {
    color: var(--danger);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px var(--shadow-color);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3em;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Avatar Selection */
.avatar-selection-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.current-avatar-preview {
    text-align: center;
}

.avatar-preview-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
}

.avatar-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.avatar-upload-btn {
    text-align: center;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.9em;
}

.avatar-grid-label {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.avatar-option {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.avatar-option:hover {
    border-color: var(--accent-primary);
}

.avatar-option.selected {
    border-color: var(--success);
    box-shadow: 0 0 0 2px var(--success);
}

/* Checkbox */
.form-group input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-container {
        padding: 15px;
    }

    .profile-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-top: -50px;
    }

    .avatar-container {
        margin-bottom: 10px;
    }

    .author-avatar {
        width: 120px;
        height: 120px;
    }

    .user-info {
        padding-top: 10px;
    }

    .user-title-row {
        flex-direction: column;
        justify-content: center;
    }

    .profile-actions {
        flex-direction: column;
    }

    .user-stats-bar {
        gap: 15px;
    }

    .stat-value {
        font-size: 1.2em;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .profile-tabs {
        flex-direction: column;
    }

    .profile-tabs .tab-btn {
        width: 100%;
    }

    .field-input-wrapper {
        flex-direction: column;
    }

    .edit-btn {
        align-self: flex-end;
    }

    .profile-actions .btn-primary,
    .profile-actions .btn-secondary {
        width: 100%;
    }

    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .avatar-option {
        width: 50px;
        height: 50px;
    }
}
