/* ====================================
   SOCIALCORE - UNIFIED STYLES
   Combines: timeline.css + layout-with-sidebar.css + feed.css
   Version: 2.0 - Met sidebar support
   ==================================== */

/* Gebruik de centrale SocialCore-variabelen */
@import url('base/_variables.css');

/* ====================================
   LAYOUT WITH SIDEBAR
   ==================================== */

.sc-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

.sc-layout__main {
    min-width: 0;
}

.sc-layout__sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ====================================
   TIMELINE CONTAINER (binnen layout)
   ==================================== */

.sc-layout__main .timeline-container {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

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

/* ====================================
   TIMELINE HEADER
   ==================================== */

.timeline-header {
    background: var(--background-white);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.timeline-title {
    margin: 0 0 5px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.timeline-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* ====================================
   POST FORM / COMPOSER
   ==================================== */

.post-form-card {
    background: var(--background-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* ====================================
   POSTS CONTAINER
   ==================================== */

.posts-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* ====================================
   POST CARD
   ==================================== */

.post-card,
.sc-post {
    background: var(--background-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    margin-bottom: 0;
    /* Prevent double spacing */
}

.post-card:hover,
.sc-post:hover {
    box-shadow: var(--shadow-md);
}

/* ====================================
   POST HEADER
   ==================================== */

.post-header,
.sc-post__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.post-author {
    display: flex;
    gap: 12px;
    align-items: center;
}

.author-avatar,
.sc-post__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.author-link,
.sc-post__author {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.author-link:hover,
.sc-post__author:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.post-arrow {
    color: var(--text-muted);
    font-weight: normal;
}

.post-time,
.sc-post__time {
    font-size: 13px;
    color: var(--text-muted);
}

/* ====================================
   POST MENU
   ==================================== */

.post-menu {
    position: relative;
}

.menu-button {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.menu-button:hover {
    background: var(--background-light);
    color: var(--text-dark);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    min-width: 150px;
    z-index: 10;
    display: none;
}

.menu-dropdown.show {
    display: block;
}

.menu-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.menu-item:hover {
    background: var(--background-light);
}

.menu-item.delete-item {
    color: var(--danger-color);
}

.menu-item.delete-item:hover {
    background: rgba(220, 53, 69, 0.1);
}

/* ====================================
   POST CONTENT
   ==================================== */

/* .post-content,
.sc-post__body {
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-dark);
    word-wrap: break-word;
    white-space: pre-wrap;
} */

/* ====================================
   LINK PREVIEW
   ==================================== */

.link-preview-section {
    margin: 15px 0;
}

.link-preview-card {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-decoration: none;
    transition: var(--transition);
    background: var(--background-white);
}

.link-preview-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.link-preview-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.link-preview-content {
    padding: 15px;
}

.link-preview-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.link-preview-description {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.4;
}

.link-preview-domain {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 500;
}

/* ====================================
   POST MEDIA
   ==================================== */

.post-media,
.sc-post__gallery {
    margin: 15px 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.post-image,
.sc-post__img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
}

.post-image:hover,
.sc-post__img:hover {
    opacity: 0.95;
}

/* Media Gallery Layouts */
.sc-post__gallery.is-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.sc-post__gallery.is-single {
    margin-top: 10px;
}

.sc-post__gallery.is-grid .sc-post__img {
    height: 220px;
    object-fit: cover;
}

.sc-post__gallery.is-single .sc-post__img {
    height: auto;
    max-height: 520px;
    object-fit: cover;
}

/* ====================================
   POST ACTIONS (Likes, Comments, Share)
   ==================================== */

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

.action-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    background: var(--background-light);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.action-button:hover {
    background: var(--background-white);
    border-color: var(--border-color);
    transform: translateY(-1px);
}

.action-button .action-icon {
    font-size: 16px;
}

.like-button.liked {
    color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.like-button.liked .action-icon {
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* ====================================
   COMMENTS SECTION
   ==================================== */

.comments-section {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.comments-section.show {
    display: block;
}

.comments-list {
    margin-bottom: 15px;
}

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

.comment-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.comment-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    transition: var(--transition);
}

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

.comment-submit {
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.comment-submit:hover {
    background: var(--primary-hover);
}

/* ====================================
   SIDEBAR WIDGETS
   ==================================== */

.sc-widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.sc-widget__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-widget__title i {
    color: #0ea5e9;
}

/* Friends Widget */
.sc-friends-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.sc-friend-item:hover {
    background: #f9fafb;
}

.sc-friend-item__avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.sc-friend-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-friend-item__online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}

.sc-friend-item__info {
    flex: 1;
    min-width: 0;
}

.sc-friend-item__name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-friend-item__status {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* Hashtags Widget */
.sc-hashtag-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sc-hashtag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.sc-hashtag-item:hover {
    background: #f0f9ff;
    transform: translateX(4px);
}

.sc-hashtag-item__name {
    font-weight: 600;
    color: #0ea5e9;
    font-size: 14px;
}

.sc-hashtag-item__count {
    font-size: 12px;
    color: var(--text-muted);
    background: white;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Inline Post Content Links */
.hashtag-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.hashtag-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.mention-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.mention-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.post-link {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
    transition: color 0.2s ease;
}

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

/* Suggestions Widget */
.sc-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
}

.sc-suggestion-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.sc-suggestion-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sc-suggestion-item__info {
    flex: 1;
    min-width: 0;
}

.sc-suggestion-item__name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-suggestion-item__mutual {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.sc-suggestion-item__follow {
    padding: 6px 12px;
    background: #0ea5e9;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.sc-suggestion-item__follow:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

/* Follow button states */
.sc-suggestion-item__follow:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.sc-suggestion-item__follow.sent {
    background: #10b981;
}

/* Suggestion name as link */
a.sc-suggestion-item__name {
    text-decoration: none;
    transition: color 0.2s;
}

a.sc-suggestion-item__name:hover {
    color: #0ea5e9;
}

/* Suggestion avatar as link */
a.sc-suggestion-item__avatar {
    display: block;
}

a.sc-suggestion-item__avatar:hover img {
    opacity: 0.9;
}

/* Stats Widget */
.sc-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sc-stat-item {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.sc-stat-item__value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px 0;
}

.sc-stat-item__label {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

/* Widget Footer */
.sc-widget-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
}

.sc-widget-footer a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.sc-widget-footer a:hover {
    color: #0ea5e9;
}

.sc-view-all {
    display: block;
    text-align: center;
    padding: 8px;
    color: #0ea5e9;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.sc-view-all:hover {
    background: #f0f9ff;
}

.sc-widget-empty {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 14px;
}

/* ====================================
   EMPTY STATE
   ==================================== */

.empty-state {
    background: var(--background-white);
    padding: 60px 20px;
    text-align: center;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-title {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.empty-text {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* ====================================
   PAGINATION
   ==================================== */

.sc-pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.sc-page {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    background: white;
    transition: var(--transition);
}

.sc-page:hover {
    background: var(--background-light);
    border-color: var(--primary-color);
}

.sc-page__stat {
    color: var(--text-muted);
    font-size: 14px;
}

/* ====================================
   RESPONSIVE DESIGN
   ==================================== */

@media (max-width: 1024px) {
    .sc-layout {
        grid-template-columns: 1fr 280px;
        gap: 16px;
    }

    .sc-layout__sidebar {
        top: 70px;
    }
}

@media (max-width: 968px) {
    .sc-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sc-layout__sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .sc-layout {
        padding: 10px;
    }

    .timeline-container {
        padding: 10px;
    }

    .post-card,
    .sc-post {
        padding: 15px;
        border-radius: var(--radius-sm);
    }

    .sc-layout__sidebar {
        grid-template-columns: 1fr;
    }

    .sc-widget {
        padding: 16px;
    }

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

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

    .action-button {
        flex: 1;
        min-width: calc(33.333% - 8px);
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .timeline-title {
        font-size: 20px;
    }

    .author-avatar,
    .sc-post__avatar {
        width: 40px;
        height: 40px;
    }

    .action-button .action-text {
        display: none;
    }

    .action-button {
        min-width: 60px;
        justify-content: center;
        padding: 8px 10px;
    }

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

    .sc-widget-footer {
        justify-content: center;
    }

    .sc-post__gallery.is-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ====================================
   UTILITY CLASSES
   ==================================== */

.sc-muted {
    color: var(--text-muted);
}

.sc-prose {
    line-height: 1.6;
}

/* Prevent image overflow */
.timeline-container img,
.post-media img,
.sc-post__gallery img {
    max-width: 100%;
    height: auto;
}

/* Ensure link previews have proper sizing */
.timeline-container .link-preview-img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
}

/* Video in posts */
.post-videos {
    margin: 12px 0;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.post-video {
    width: 100%;
    max-height: 500px;
    display: block;
}

.post-video:focus {
    outline: none;
}
