:root {
    --primary-color: #005a9c;
    --secondary-color: #333;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333;
    --header-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background-color: var(--background-color); color: var(--text-color); }

/* Header Styles */
.top-bar { background-color: var(--secondary-color); color: white; padding: 0.5rem 0; text-align: center; font-size: 0.9em; }
.top-bar .social-icons a, .top-bar .contact-info span { color: white; text-decoration: none; margin: 0 12px; transition: color 0.3s; }
.top-bar .social-icons a:hover { color: var(--primary-color); }
.header { width: 100%; height: var(--header-height); background-color: #f3f4f6; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; z-index: 1000; position: sticky; top: 0; }
.header .logo { height: 50px; padding-right: 10px; }
.header nav a { color: var(--primary-color); text-decoration: none; font-weight: 500; padding: 0.5rem 1rem; border-radius: 5px; margin-left: 0.5rem; transition: background-color 0.3s, color 0.3s; }
.header nav a:hover, .header nav a.active { background-color: var(--primary-color); color: var(--card-background); }

.payment-alert {
    background: #e5e7eb;
    color: #111827;
    padding: 10px 16px;
    text-align: center;
    font-weight: 700;
    font-size: 0.92rem;
    line-height: 1.2;
}
.payment-alert a {
    color: #111827;
    text-decoration: underline;
    font-weight: 700;
}
.payment-alert i {
    font-size: 1.1rem;
    margin-right: 6px;
}

@media (max-width: 480px) {
    .payment-alert {
        font-size: 0.78rem;
        padding: 8px 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Layout */
.main-container {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 20px;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    align-items: start;
}

/* Sidebars */
.sidebar { position: sticky; top: 80px; }
.sidebar-card { background: var(--card-background); border-radius: 8px; padding: 15px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); margin-bottom: 15px; }
.sidebar-link { display: flex; align-items: center; padding: 10px; color: var(--text-color); text-decoration: none; border-radius: 8px; transition: background 0.2s; font-weight: 500; }
.sidebar-link:hover { background-color: #e4e6eb; }
.sidebar-link i { font-size: 24px; margin-right: 15px; color: var(--primary-color); width: 30px; text-align: center; }
.sidebar-link.active {
    background-color: #e6f0fa;
    color: var(--primary-color);
}

/* Feed */
.feed { display: flex; flex-direction: column; gap: 20px; }

/* Search Bar in Feed */
.feed-search { background: var(--card-background); padding: 10px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 10px; }
.feed-search input { flex: 1; border: none; background: #f0f2f5; padding: 10px 15px; border-radius: 20px; font-size: 1rem; outline: none; }
.feed-search i { color: #65676b; }

/* Create Post */
.create-post { background: var(--card-background); border-radius: 8px; padding: 15px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.create-post-top { display: flex; gap: 10px; margin-bottom: 15px; border-bottom: 1px solid #e4e6eb; padding-bottom: 15px; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; background: #ccc; object-fit: cover; }
.create-post-input { flex: 1; border: none; background: #f0f2f5; padding: 10px 15px; border-radius: 20px; font-size: 1rem; cursor: pointer; color: #65676b; }
.create-post-input:hover { background: #e4e6eb; }
.create-post-actions { display: flex; justify-content: space-between; }
.action-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px; border-radius: 8px; cursor: pointer; color: #65676b; font-weight: 600; transition: background 0.2s; }
.action-btn:hover { background: #f0f2f5; }
.action-btn.photo { color: #45bd62; }
.action-btn.video { color: #f02849; }
.action-btn.feeling { color: #f7b928; }
.post-action-btn.liked { color: var(--primary-color); }

/* Post Card */
.post { background: var(--card-background); border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.post-header { padding: 10px; display: flex; align-items: center; gap: 10px; }
.post-info h4 { font-size: 15px; margin-bottom: 3px; }
.post-info span { font-size: 13px; color: #65676b; }
.post-content { padding: 0 10px 10px; font-size: 14px; }
.post-image { width: 100%; display: block; height: auto; object-fit: cover; max-height: 400px; cursor: pointer; }
.post-stats { padding: 8px 10px; border-bottom: 1px solid #e4e6eb; display: flex; justify-content: space-between; color: #65676b; font-size: 13px; }
.post-actions { padding: 4px 10px; display: flex; border-bottom: 1px solid #e4e6eb; }
.post-action-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px; border-radius: 4px; cursor: pointer; color: #65676b; font-weight: 600; transition: background 0.2s; font-size: 14px; }
.post-action-btn:hover { background: #f0f2f5; }

/* Comments */
.comments-section { padding: 10px 15px; }
.comment { display: flex; gap: 10px; margin-bottom: 10px; }
.comment-bubble { background: #f0f2f5; padding: 8px 12px; border-radius: 18px; }
.comment-author { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.comment-text { font-size: 14px; }
.comment-input-area { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.comment-input { flex: 1; background: #f0f2f5; border: none; padding: 8px 12px; border-radius: 18px; outline: none; }
.comment-post-btn { border: none; background: transparent; color: var(--primary-color); cursor: pointer; font-size: 1.1rem; padding: 5px; transition: transform 0.2s; }
.comment-post-btn:hover { transform: scale(1.1); }
.comments-list { max-height: 300px; overflow-y: auto; margin-bottom: 10px; padding-right: 5px; }
.comments-list::-webkit-scrollbar { width: 5px; }
.comments-list::-webkit-scrollbar-thumb { background: #ccc; border-radius: 5px; }

/* Mobile Bottom Nav */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: #fff; box-shadow: 0 -2px 5px rgba(0,0,0,0.1); z-index: 1001; justify-content: space-around; padding: 10px 0; height: 60px; }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #65676b; font-size: 10px; flex: 1; }
.mobile-nav-item i { font-size: 20px; margin-bottom: 4px; }
.mobile-nav-item:active { transform: scale(0.95); }
.mobile-nav-item.active { color: var(--primary-color); }

/* Mobile UI Adjustments */
@media (max-width: 768px) {
    .main-container { grid-template-columns: 1fr; margin: 10px auto 0; padding: 0 12px 70px; width: 100%; } /* Add padding for bottom nav */
    .feed { width: 100%; }
    .left-sidebar, .right-sidebar { display: none; }
    .header nav { display: none; }
    .mobile-nav { display: flex; }
    .post-content { font-size: 15px; }
}

/* Responsive */
@media (max-width: 1100px) {
    .main-container { grid-template-columns: 1fr; margin: 10px auto 0; padding: 0 16px 70px; width: 100%; }
    .left-sidebar, .right-sidebar { display: none; }
    .feed { width: 100%; }
}
@media (max-width: 768px) {
}
.feed-section { animation: fadeIn 0.3s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Image Modal */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; background-color: rgba(0,0,0,0.9); }
.modal-content { display: flex; width: 90%; height: 90%; margin: 2.5% auto; background-color: #fff; border-radius: 8px; overflow: hidden; position: relative; }
.modal-image-container { flex: 2; background-color: #000; display: flex; align-items: center; justify-content: center; height: 100%; }
.modal-image-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
.modal-comments-container { flex: 1; display: flex; flex-direction: column; background-color: #fff; border-left: 1px solid #ddd; height: 100%; }
.modal-comments-header { padding: 15px; border-bottom: 1px solid #eee; font-weight: bold; font-size: 1.1em; }
.modal-comments-list { flex: 1; overflow-y: auto; padding: 15px; }
.close-modal { position: absolute; top: 15px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; cursor: pointer; z-index: 2001; }
@media (max-width: 900px) { .modal-content { flex-direction: column; } .modal-image-container { flex: 1; } .modal-comments-container { flex: 1; } }

/* Loading Spinner */
.loader-container { display: flex; justify-content: center; padding: 40px; }
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.payment-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
}
.payment-modal {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
    max-width: 420px;
    width: 100%;
    padding: 18px 20px 16px;
    text-align: center;
}
.payment-modal h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 1.1rem;
}
.payment-modal p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 14px;
}
.payment-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}
.payment-modal-actions button,
.payment-modal-actions a {
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}
.pay-now-btn {
    background: var(--primary-color);
    color: #fff;
}
.pay-cancel-btn {
    background: #eef2f7;
    color: #374151;
}

.share-sheet {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3100;
    padding: 16px;
}

.share-sheet.open {
    display: flex;
}

.share-sheet-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.2);
    max-width: 420px;
    width: 100%;
    padding: 16px 18px 18px;
    text-align: center;
}

.share-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.share-sheet-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #111827;
}

.share-sheet-close {
    border: none;
    background: transparent;
    font-size: 1.6rem;
    color: #64748b;
    cursor: pointer;
}

.share-sheet-text {
    font-size: 0.9rem;
    color: #475569;
    margin: 6px 0 14px;
    max-height: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-sheet-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.share-sheet-action {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #0f172a;
    cursor: pointer;
    font-size: 0.8rem;
}

.share-sheet-action i {
    font-size: 1.2rem;
}

.share-sheet-device {
    border: none;
    width: 100%;
    background: var(--primary-color);
    color: #ffffff;
    font-weight: 600;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .share-sheet-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
