/* ============================================
   PROFILE PAGE STYLES
   ============================================ */

.profile-container {
    min-height: 100vh;
    background: var(--bg-primary, #0f0f1e);
    padding-bottom: 3rem;
}

/* Cover Photo */
.profile-cover {
    height: 300px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a2e;
    position: relative;
}

.btn-upload-cover {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    transition: 0.3s;
}

.btn-upload-cover:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Profile Header */
.profile-header {
    background: var(--bg-secondary, #1f212e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: -80px;
    position: relative;
    z-index: 10;
}

.profile-header-content {
    display: flex;
    gap: 2rem;
    padding: 2rem 0;
}

/* Profile Picture */
.profile-picture-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--bg-secondary, #1f212e);
    background: #1a1a2e;
    overflow: hidden;
    /* Ensures contents stay circular */
}

.profile-picture {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    /* Radius handled by wrapper */
    border: none;
    transition: transform 0.3s ease;
}

.btn-upload-picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.profile-picture-wrapper:hover .btn-upload-picture {
    opacity: 1;
}

.profile-picture-wrapper:hover .profile-picture {
    transform: scale(1.05);
    /* Subtle zoom effect */
}

.btn-upload-picture ion-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    color: var(--accent, #e94560);
}

.btn-upload-picture::after {
    content: 'CAMBIAR';
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* Profile Info */
.profile-info {
    flex: 1;
    padding-top: 1rem;
}

.profile-name-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-username {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.profile-rank {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Bio */
.profile-bio {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.profile-bio p {
    color: #ccc;
    margin: 0;
    flex: 1;
}

.btn-edit-bio {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: 0.3s;
}

.btn-edit-bio:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Profile Details */
.profile-details-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: #ccc;
    font-size: 0.95rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-item ion-icon {
    color: var(--accent, #e94560);
    font-size: 1.1rem;
}

/* Modal Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    color: white;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: 0.3s;
}

.form-control:focus {
    border-color: var(--accent, #e94560);
    background: rgba(255, 255, 255, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Stats */
.profile-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: 0.3s;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    color: #999;
    font-size: 0.9rem;
}

/* Action Buttons */
.profile-actions {
    display: flex;
    gap: 1rem;
}

.profile-actions .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-primary {
    background: var(--accent, #e94560);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #d63651;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid #dc3545;
}

.btn-danger:hover {
    background: #dc3545;
    color: white;
}

.btn-accent {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.btn-accent:hover {
    background: #ffc107;
    color: #000;
}

/* Tabs */
.profile-tabs {
    background: var(--bg-secondary, #1f212e);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 60px;
    z-index: 100;
}

.tabs-nav {
    display: flex;
    gap: 0;
}

.tab-btn {
    background: none;
    border: none;
    color: #999;
    padding: 1rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--accent, #e94560);
    border-bottom-color: var(--accent, #e94560);
}

/* Tab Content */
.profile-content {
    padding: 2rem 0;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
}

.profile-main-content {
    min-width: 0;
}

.profile-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Create Post Card */
.create-post-card {
    background: var(--bg-secondary, #1f212e);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.create-post-card textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    color: white;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.post-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-attach-image {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    color: white;
    font-weight: 600;
    transition: 0.3s;
}

.btn-attach-image:hover {
    background: rgba(255, 255, 255, 0.2);
}

#imagePreview {
    position: relative;
    margin-top: 1rem;
}

#imagePreview img {
    max-width: 200px;
    border-radius: 8px;
}

#imagePreview button {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Post Card */
.post-card {
    background: var(--bg-secondary, #1f212e);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.post-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-username {
    color: white;
    font-weight: 600;
    text-decoration: none;
}

.post-username:hover {
    color: var(--accent, #e94560);
}

.post-date {
    color: #999;
    font-size: 0.85rem;
}

.btn-delete-post {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: 0.3s;
}

.btn-delete-post:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.post-content p {
    color: white;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Hashtags */
.hashtag {
    color: var(--accent, #e94560);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.hashtag:hover {
    text-decoration: underline;
    color: #ff6b81;
}


.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 1rem;
}

.post-actions {
    display: flex;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.post-action-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    transition: 0.3s;
}

.post-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.post-action-btn.liked {
    color: var(--accent, #e94560);
}

/* Comments */
.post-comments {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.comment-form input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.75rem 1rem;
    color: white;
}

.comment-form button {
    background: var(--accent, #e94560);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Favorites Grid */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
}

.anime-card {
    background: var(--bg-secondary, #1f212e);
    border-radius: 8px;
    overflow: hidden;
    transition: 0.3s;
}

.anime-card:hover {
    transform: translateY(-5px);
}

.anime-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.anime-card h3 {
    padding: 1rem;
    color: white;
    font-size: 0.9rem;
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}

.empty-state ion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Settings */
.settings-section {
    background: var(--bg-secondary, #1f212e);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    color: white;
    margin-bottom: 1rem;
}

.setting-item {
    padding: 1rem 0;
}

.setting-item label {
    color: white;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-stats {
        justify-content: center;
    }

    .profile-actions {
        flex-direction: column;
    }

    .tabs-nav {
        overflow-x: auto;
    }

    .tab-btn {
        white-space: nowrap;
    }

    .profile-content {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        position: static;
        order: -1;
    }
}