/* Social Feed & Components */

/* Comment Section Container */
.comments-container {
    background-color: var(--md-sys-color-surface-container-low, #F7F2FA);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual Comment Bubble */
.comment-bubble {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content-box {
    background-color: var(--md-sys-color-surface-container-high, #ECE6F0);
    padding: 8px 12px;
    border-radius: 0 16px 16px 16px; /* Top-left corner sharp for "speech bubble" effect */
    max-width: 90%;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface, #1D1B20);
    margin: 0;
}

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

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

.comment-author-link:hover .comment-avatar {
    opacity: 0.8;
}

.comment-timestamp {
    font-size: 0.75rem;
    color: var(--md-sys-color-on-surface-variant, #49454F);
}

.comment-text {
    font-size: 0.9rem;
    color: var(--md-sys-color-on-surface, #1D1B20);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Comment Input Form */
.comment-form-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    background-color: var(--md-sys-color-surface, #FEF7FF);
    border-radius: 24px;
    padding: 4px 4px 4px 16px;
    border: 1px solid var(--md-sys-color-outline-variant, #CAC4D0);
    transition: border-color 0.2s;
}

.comment-form-container:focus-within {
    border-color: var(--md-sys-color-primary, #6750A4);
    box-shadow: 0 0 0 1px var(--md-sys-color-primary, #6750A4);
}

.comment-input {
    flex-grow: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--md-sys-color-on-surface, #1D1B20);
    padding: 8px 0;
}

.comment-input::placeholder {
    color: var(--md-sys-color-on-surface-variant, #49454F);
}

.comment-submit-btn {
    background: var(--md-sys-color-primary, #6750A4);
    color: var(--md-sys-color-on-primary, #FFFFFF);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.comment-submit-btn:hover {
    background: var(--md-sys-color-primary-container, #EADDFF);
    color: var(--md-sys-color-on-primary-container, #21005D);
}

.comment-submit-btn:active {
    transform: scale(0.95);
}

.comment-submit-btn .material-symbols-outlined {
    font-size: 20px;
}

/* --------------------------------------------------------------------------
   Post Cards (Extracted from feed.html)
   -------------------------------------------------------------------------- */

.post-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 32px;
    margin-bottom: 32px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);

    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    animation: card-entry 0.6s ease-out;
}

html[data-mdc-theme="dark"] .post-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@keyframes card-entry {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.post-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    gap: 16px;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px; /* Squircle style */
    object-fit: cover;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.post-user-link {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

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

.post-user-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: var(--md-sys-color-on-surface);
    margin: 0;
}

.post-time {
    font-size: 13px;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.7;
    margin: 0;
}

.post-content {
    padding: 0 24px 24px;
}

.post-text {
    margin: 0 0 16px 0;
    line-height: 1.6;
    font-size: 16px;
    color: var(--md-sys-color-on-surface);
}

.post-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    object-position: top;
    background: rgba(var(--md-sys-color-on-surface-rgb), 0.03);
    border-radius: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.post-actions {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    align-items: center;
    padding: 12px 24px 20px;
    border-top: 1px solid rgba(var(--md-sys-color-outline-variant-rgb, 196, 198, 208), 0.1);
    margin-top: 8px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 14px;
}

.action-btn:hover {
    background: rgba(var(--md-sys-color-primary-rgb, 0, 99, 155), 0.08);
    color: var(--md-sys-color-primary);
}

.action-btn.liked {
    color: #ff4081;
}

.action-btn.liked .material-symbols-outlined {
    font-variation-settings: 'FILL' 1;
}

/* Override old comment styles with the glassmorphism ones */
.comments-section {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 16px 0; /* Padding collapse to avoid empty space */
    border-top: 1px solid transparent;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1), opacity 0.3s ease-out, padding 0.3s ease-out, border-color 0.3s ease-out;
}

.comments-section.show {
    max-height: 2000px; /* Arbitrary large max-height */
    opacity: 1;
    padding: 16px 16px 24px;
    border-top: 1px solid rgba(var(--md-sys-color-outline-variant-rgb, 196, 198, 208), 0.1);
    transition: max-height 0.6s ease-in-out, opacity 0.5s ease-in, padding 0.4s ease-in, border-color 0.4s ease;
}

.comment-bubble {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    animation: card-entry 0.4s ease-out;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    object-fit: cover;
}

.comment-content-box {
    flex: 1;
    background: rgba(var(--md-sys-color-surface-variant-rgb, 224, 226, 236), 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 14px 18px;
    border-radius: 20px;
    color: var(--md-sys-color-on-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

html[data-mdc-theme="light"] .comment-content-box {
    background: rgba(0, 0, 0, 0.03);
}

.comment-author-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--md-sys-color-primary);
    margin: 0 0 4px 0;
}

.comment-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

/* Verified badge — inline con nombre de usuario en todos los contextos */
.verified-badge {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    color: var(--md-sys-color-primary);
    line-height: 1;
}

.verified-badge .material-symbols-outlined {
    font-size: 18px;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 18;
}

/* === Comment edit/delete actions === */
.comment-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.comment-action-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--md-sys-color-outline);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease;
}

.comment-action-btn .material-symbols-outlined {
    font-size: 16px;
}

.comment-action-btn:hover {
    background: var(--md-sys-color-surface-variant);
}

.comment-action-delete:hover {
    color: var(--md-sys-color-error);
}

.comment-edit-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
