/* ===== SOCIAL NETWORK FEED ===== */
.social-feed {
    padding: 20px 0;
}

.social-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Category Filters */
.category-filters {
    margin-bottom: 20px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border-color);
}

.category-filters-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--gray-400) transparent;
}

.category-filters-scroll::-webkit-scrollbar {
    height: 4px;
}

.category-filters-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.category-filters-scroll::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 2px;
}

.category-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--background-elevated);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.category-filter:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.category-filter.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: white;
}

.category-filter.active:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.category-filter i {
    font-size: 16px;
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-posts i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-posts p {
    font-size: 16px;
    margin: 0;
}

/* Create Post Card */
.create-post-card {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.create-post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.create-post-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    font-size: 14px;
}

.create-post-input:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.create-post-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.create-post-action {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.create-post-action:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.create-post-action i {
    font-size: 18px;
}

/* Post Card */
.post-card {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.post-author-info {
    flex: 1;
}

.post-author-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.post-author-name:hover {
    color: var(--primary-red);
    cursor: pointer;
}

.post-time {
    font-size: 12px;
    color: var(--text-tertiary);
}

.post-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--light-red);
    color: var(--primary-red);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.post-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--gray-100);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    border: 1px solid var(--border-color);
}

.post-category-badge[data-category="pokemon"] {
    background: rgba(238, 97, 72, 0.1);
    color: var(--primary-red);
    border-color: rgba(238, 97, 72, 0.3);
}

.post-category-badge[data-category="yugioh"] {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
    border-color: rgba(33, 150, 243, 0.3);
}

.post-category-badge[data-category="onepiece"] {
    background: rgba(255, 152, 0, 0.1);
    color: #FF9800;
    border-color: rgba(255, 152, 0, 0.3);
}

.post-category-badge[data-category="magic"] {
    background: rgba(156, 39, 176, 0.1);
    color: #9C27B0;
    border-color: rgba(156, 39, 176, 0.3);
}

.post-category-badge[data-category="digimon"] {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    border-color: rgba(76, 175, 80, 0.3);
}

.post-category-badge[data-category="other"] {
    background: var(--gray-100);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.post-category-badge i {
    font-size: 10px;
}

.post-content {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.post-content .mention {
    color: var(--primary-red);
    font-weight: 500;
    cursor: pointer;
}

.post-content .mention:hover {
    text-decoration: underline;
}

.post-content code.inline-code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    color: var(--primary-red);
}

.post-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.post-content em {
    font-style: italic;
}

.post-content a.comment-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
}

.post-content a.comment-link:hover {
    text-decoration: underline;
}

.post-content br {
    line-height: 1.6;
}

.post-media {
    margin-bottom: 12px;
    border-radius: var(--radius);
    overflow: hidden;
}

.post-media img,
.post-media video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 500px;
    object-fit: contain;
    background: var(--gray-100);
}

/* Post Media Carousel */
.post-media-carousel {
    position: relative;
    margin-bottom: 12px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
}

.carousel-wrapper {
    position: relative;
    width: 100%;
}

.carousel-slides {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-slide {
    display: none;
    width: 100%;
}

.carousel-slide.active {
    display: block;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
    background: var(--gray-100);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: var(--transition);
}

.carousel-nav:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-indicators-wrapper {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.carousel-indicator.active {
    background: white;
    width: 24px;
    border-radius: 4px;
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.post-action-btn {
    flex: 1;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.post-action-btn:hover {
    background: var(--gray-100);
    color: var(--text-primary);
}

.post-action-btn.liked {
    color: var(--primary-red);
}

.post-action-btn i {
    font-size: 18px;
}

.post-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.post-likes-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-comments-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

.post-comments-toggle:hover {
    color: var(--primary-red);
}

/* Comments Section */
.post-comments {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.show-all-comments-btn {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.show-all-comments-btn:hover {
    background: var(--gray-100);
    border-color: var(--primary-red);
    color: var(--primary-red);
}

.show-all-comments-btn i {
    font-size: 16px;
}

.comment {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.comment:last-child {
    margin-bottom: 0;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    margin-right: 6px;
}

.comment-author-link {
    text-decoration: none;
    color: inherit;
}

.comment-author-link:hover .comment-author {
    color: var(--primary-red);
    cursor: pointer;
}

.post-author-link {
    text-decoration: none;
    color: inherit;
}

.post-author-link:hover {
    color: var(--primary-red);
}

.comment-text {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    margin-top: 2px;
}

.comment-text .mention {
    color: var(--primary-red);
    font-weight: 500;
    cursor: pointer;
}

.comment-text .mention:hover {
    text-decoration: underline;
}

.comment-text code.inline-code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    color: var(--primary-red);
}

.comment-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-text em {
    font-style: italic;
}

.comment-text a.comment-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 500;
}

.comment-text a.comment-link:hover {
    text-decoration: underline;
}

.comment-text br {
    line-height: 1.6;
}

/* Form Styles for Create Post Modal */
.create-post-form .form-group {
    margin-bottom: 16px;
}

.create-post-form .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.create-post-form .form-label i {
    color: var(--primary-red);
    font-size: 14px;
}

.create-post-form .form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: var(--transition);
}

.create-post-form .form-select:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(238, 97, 72, 0.1);
}

.create-post-form .form-select option {
    background: var(--background-card);
    color: var(--text-primary);
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
}

.comment-action {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0;
    font-size: 12px;
}

.comment-action:hover {
    color: var(--primary-red);
}

.comment-time {
    color: var(--text-tertiary);
    font-size: 12px;
}

/* Comment Replies (Tutte allo stesso livello) */
.comment-reply {
    margin-left: 40px;
    margin-top: 12px;
    padding-left: 12px;
    border-left: 2px solid var(--border-color);
    position: relative;
}

/* Tutte le risposte hanno lo stesso livello di indentazione */
.comment-reply[data-level="1"] {
    margin-left: 40px;
}

.comment-reply .comment-avatar {
    width: 28px;
    height: 28px;
}

.comment-reply .comment-author {
    font-size: 12px;
}

.comment-reply .comment-text {
    font-size: 13px;
}

.comment-replies {
    margin-top: 12px;
    padding-top: 8px;
}

.comment-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.comment-reply-btn:hover {
    color: var(--primary-red);
    background: var(--gray-100);
}

.comment-reply-form {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    width: 100%;
    clear: both;
    visibility: hidden;
    opacity: 0;
    position: relative;
    z-index: 1;
}

.comment-reply-form.active {
    display: flex;
    visibility: visible;
    opacity: 1;
}

.comment-reply-form .comment-input-wrapper {
    width: 100%;
    display: flex;
    align-items: stretch;
}

.comment-reply-input {
    font-size: 13px;
    padding: 8px 12px;
    width: 100%;
    min-height: 40px;
    max-height: 100px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    resize: none;
    font-family: 'Roboto', sans-serif;
    line-height: 1.4;
}

.comment-reply-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(238, 97, 72, 0.1);
}

.comment-reply-input::placeholder {
    color: var(--text-tertiary);
}

.comment-reply-submit {
    padding: 10px 16px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
}

.comment-reply-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.comment-reply-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-reply-submit i {
    font-size: 14px;
}

/* Comment Form */
.comment-form {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 1;
}

.comment-input-wrapper {
    flex: 1;
    position: relative;
}

.comment-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--background-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 14px;
    color: var(--text-primary);
    resize: none;
    min-height: 40px;
    max-height: 120px;
    font-family: 'Roboto', sans-serif;
}

.comment-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(238, 97, 72, 0.1);
}

.comment-input::placeholder {
    color: var(--text-tertiary);
}

.comment-submit {
    padding: 10px 16px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.comment-submit:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Create Post Modal */
.modal-content.create-post-modal {
    max-width: 600px;
    width: 90%;
    padding: 24px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-top: 0;
}

.modal-header h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.create-post-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--background-elevated);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text-primary);
    resize: vertical;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(238, 97, 72, 0.1);
}

.form-textarea::placeholder {
    color: var(--text-tertiary);
}

.media-preview {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-100);
}

.media-preview-item {
    position: relative;
}

.media-preview img,
.media-preview video {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    display: block;
}

.media-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.media-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

.file-upload-label {
    display: block;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--background-elevated);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.file-upload-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
    background: var(--light-red);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.loading-more {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.loading-more i {
    margin-right: 8px;
}

/* Responsive Social Feed */
@media (max-width: 768px) {
    .social-container {
        padding: 0 16px;
    }

    .create-post-card {
        padding: 12px;
    }

    .post-card {
        padding: 12px;
    }

    .create-post-actions {
        flex-wrap: wrap;
    }

    .create-post-action {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
    }

    .post-actions {
        flex-wrap: wrap;
    }

    .post-action-btn {
        flex: 1 1 calc(33.333% - 6px);
        min-width: 0;
        font-size: 12px;
        padding: 6px 8px;
    }

    .modal-content.create-post-modal {
        width: 95%;
        max-width: none;
        padding: 20px;
    }

    .modal-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .create-post-form {
        gap: 16px;
    }

    /* Nascondi scrollbar orizzontale su mobile */
    .category-filters-scroll {
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE e Edge */
    }

    .category-filters-scroll::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
}

@media (max-width: 480px) {
    .social-feed {
        padding: 12px 0;
    }

    .create-post-header {
        gap: 8px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
    }

    .post-header {
        gap: 8px;
    }

    .comment-form {
        flex-direction: column;
    }

    .comment-submit {
        width: 100%;
    }
}

