:root{
    --bg: #f5f5f5;
    --card-bg: rgba(255,255,255,0.95);
    --muted: #777;
    --accent: #5b2d91;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    background-color: var(--bg);
    position: relative;
    z-index: 0;
    color: #222;
}

body.modal-open {
    overflow: hidden;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  padding: 30px;
  border-radius: 0 12px 12px 0;
  box-shadow: 4px 0 6px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.container2 {
  flex: 1;
  width: 100%;
  max-width: 600px;
  background: var(--card-bg);
  padding: 30px;
  border-radius: 0 12px 12px 0;
  box-shadow: 4px 0 6px rgba(0, 0, 0, 0.1);
  position: static;
  box-sizing: border-box;
}

.delete-btn:disabled {
    background-color: #9e9e9e !important;
    color: #f5f5f5 !important;
    border: none;
    opacity: 0.8;
    cursor: not-allowed;
    box-shadow: none;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #2c2c2c;
    color: #f3f3f3;
    padding: 14px 25px;
    font-weight: 600;
    font-size: 1.1em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.logo {
    letter-spacing: 0.5px;
}

body.main-page {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: #eceef1;
    color: #222;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
}

.main-container {
    margin-top: 120px;
    background-color: #fff;
    padding: 50px 80px;
    border-radius: 18px;
    text-align: center;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.15);
    animation: fadeIn 1.2s ease;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    width: 95%;
}

.main-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(25px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-container h1 {
    font-size: 2.1em;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1e1e1e;
}

.subtitle {
    font-size: 1.05em;
    color: #555;
    margin-bottom: 35px;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    text-decoration: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.4px;
    transition: all 0.25s ease;
}

.btn-secondary {
    background-color: #3b3b3b;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #5c5c5c;
    transform: translateY(-2px);
}

footer {
    margin-top: auto;
    text-align: center;
    padding: 20px;
    color: var(--muted);
    font-size: 0.9em;
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-icon {
    width: 42px;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #ddd;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 0 6px rgba(255,255,255,0.5);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 50px;
    background: #fff;
    color: #222;
    border: 1px solid #ccc;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 2001;
    min-width: 190px;
    text-align: center;
}

.dropdown-menu.active {
    display: block;
    animation: fadeInMenu 0.3s ease;
}

@keyframes fadeInMenu {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu p {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 10px;
}

.profile-pic {
    width: 60px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid #eee;
}

.dropdown-menu a {
    display: block;
    padding: 6px 0;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.dropdown-menu a:hover {
    color: #7647b5;
    text-decoration: underline;
}



.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0,0,0,0.65);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #ffffff;
    color: #1c1e21;
    margin: 0 auto;
    width: auto;
    max-width: 95vw;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    height: 50vh;
    max-height: 50vh;
    overflow: hidden;
}

.close-button {
    color: #888;
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.modal-body {
    display: flex;
    height: 100%;
    padding: 18px;
    gap: 0;
    min-height: 0;
}

.modal-image-container {
    display: flex;
    padding-right: 18px;
}

.modal-image-container img {
    height: 100%;
    width: auto;
    display: block;
}

.modal-details-container {
    display: flex;
    flex-direction: column;
    width: 380px;
    flex-shrink: 0;
    min-height: 0;
    position: relative;
    padding-left: 18px;
}

.modal-details-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 40%;
    width: 1px;
    background-color: #ddd;
}

.modal-header,
.modal-caption {
    flex-shrink: 0;
}

.modal-header {
    display: flex;
    position: relative;
    z-index: 1;
    align-items: center;
    padding-bottom: 8px;
}

.modal-author-info a {
    display: flex;
    align-items: center;

    color: #1c1e21;
    text-decoration: none;
    font-weight: bold;
}

.modal-author-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}
.modal-caption {
    padding: 10px 0;
    word-wrap: break-word;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 5px;
}


.modal-comments-section {
    position: relative;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-top: 15px;
}


.content-separator {
    flex-shrink: 0;
    width: 90%;
    height: 1px;
    background-color: #ddd;
    margin: 10px auto;
}

.modal-comments-section::before { content: none; }
.comment { display: flex; align-items: flex-start; margin-bottom: 12px; font-size: 14px; }
.comment img { width: 28px; height: 28px; border-radius: 50%; margin-right: 10px; }
.comment-content { word-wrap: break-word; flex: 1; }
.comment-content strong { margin-right: 5px; }
.comment-content a { color: #1c1e21; font-weight: bold; text-decoration: none; }

.modal-footer {
    flex-shrink: 0;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.modal-actions { padding-top: 0; border-top: none; }
.like-btn { font-size: 24px; color: #888; margin-right: 6px; }
.like-btn.liked { color: #e0245e; margin-right: 6px; }
.modal-comment-form { display: flex; margin-top: 10px; gap: 8px; align-items: center; }
.modal-comment-form input { flex-grow: 1; background: #f0f2f5; border: 1px solid #ddd; color: #1c1e21; padding: 8px 12px; border-radius: 20px; min-width: 0; }
.modal-comment-form input::placeholder { color: #8a8d91; }
.modal-comment-form button { background: transparent; color: #0095f6; font-weight: bold; border: none; padding: 8px 12px; cursor: pointer; }
.delete-post-btn-container { padding-top: 10px; margin-top: 10px; border-top: 1px solid #ddd; }
.delete-post-btn { background: none; border: none; color: #ed4956; cursor: pointer; font-weight: bold; padding: 5px 0; text-align: left; }

@media (max-width: 900px) {
    .modal-content {
        width: 98%;
        height: 95vh;
    }
    .modal-body {
        flex-direction: column;
    }
    .modal-details-container {
        width: 100%;
        flex-basis: 50%;
    }
}


.post-header a,
.post-image-container,
.post-thumb,
.like-btn,
.comment-icon-btn {
    cursor: pointer;
}

.post-header a:hover {
    text-decoration: underline;
}

.like-btn:hover,
.comment-icon-btn:hover {
    opacity: 0.6;
}

.post-header a, .like-btn, .comment-icon-btn {
    transition: opacity 0.2s ease, text-decoration 0.2s ease;
}



.modal-content-list {
    background-color: #ffffff;
    color: #1c1e21;
    margin: 0 auto;
    border: 1px solid #ddd;
    width: 90%;
    max-width: 20%;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 70vh;
}

#listModal .modal-body {
    display: block;
    height: 100%;
    padding: 18px;
    gap: 0;
    min-height: 0;
}

.follow-list-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.follow-list-header {
    text-align: center;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    margin: 12px;
}

.follow-list-body {
    overflow-y: auto;
    padding: 8px 16px;
    flex-grow: 1;
}

.follow-list-item {
    padding: 8px 0;
}

.follow-list-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.follow-list-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.follow-list-username {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.follow-list-empty {
    color: #888;
    text-align: center;
    padding: 20px;
}

.follow-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    gap: 15px;
}

.follow-user-info {
    display: flex;
    flex-direction: column;
}

.follow-list-fullname {
    font-size: 12px;
    color: #888;
}

.follow-toggle-btn {
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.follow-toggle-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.follow-style {
    background-color: #0095f6;
    color: white;
}
.follow-style:hover {
    background-color: #0077c3;
}

.unfollow-style {
    background-color: #efefef;
    color: #262626;
}
.unfollow-style:hover {
    background-color: #dbdbdb;
}




.comment-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

.comment-content strong { margin-right: 5px; }
.comment-content a { color: #1c1e21; font-weight: bold; text-decoration: none; }
.comment-text {
    padding-right: 25px;
}


.comment-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 4px;
}

.comment-actions {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1000;
}

.comment-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    bottom: auto;

    margin-top: 5px;

    background-color: #ffffff;
    border: 1px solid #dbdbdb;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 10001;

    border-radius: 6px;
    width: 150px;
    overflow: hidden;
}
.comment-time {
    font-size: 12px;
    color: #888;
}


.comment-options-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #888;
    padding: 2px 8px;
}


.dropdown-item {
    display: block;
    width: 100%;
    padding: 10px 15px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f0f0f0;
}

.delete-comment-btn {
    color: #ed4956;
    font-weight: bold;
}

.comment-content-cell {
    max-width: 300px;
    word-wrap: break-word;
}

.toast-container {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-message {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    animation: slideDownFadeIn 0.5s ease forwards;
}

.toast-message.hiding {
    animation: slideUpFadeOut 0.5s ease forwards;
}

.toast-text {
    flex-grow: 1;
    text-align: center;
    margin-right: 15px;
}

.toast-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-message.success { background-color: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.toast-message.error { background-color: #f8d7da; color: #842029; border: 1px solid #f5c6cb; }
.toast-message.warning { background-color: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }
.toast-message.info { background-color: #cff4fc; color: #055160; border: 1px solid #b6effb; }

@keyframes slideDownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-30px);
    }
}

.d-none {
    display: none;
}

.text-center { text-align: center; }
.p-20 { padding: 20px; }
.color-gray { color: #888; }
.cp-error { color: red; }
.cursor-pointer { cursor: pointer; }


.conversation {
    overflow: visible !important;
    position: relative;
}


.conversations-list {
    overflow: visible !important;
}


.conv-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 10001 !important;
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
