/* --- BASE SETUP --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --nav-bg: #679ba7;
    --nav-border: #de354c;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --accent: #2c7a7b;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* --- UPPER NAVIGATION BAR --- */
.navbar {
    background-color: var(--nav-bg);
    border-bottom: 4px solid var(--nav-border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 10px 20px;
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.user-badge {
    background-color: rgba(255, 255, 255, 0.25);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: white;
    margin-left: 10px;
    border: 1px dashed white;
}

.nav-links {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.nav-links a:hover, .nav-links a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-links a.login-btn {
    background-color: #ffffff;
    color: var(--accent);
    font-weight: 600;
}

.nav-links a.signup-nav-btn {
    background-color: transparent;
    border: 1px solid white;
    font-weight: 600;
}

.nav-links a.logout-style {
    background-color: var(--nav-border) !important;
}

/* --- LAYOUT & MAIN FEED --- */
.main-container {
    max-width: 650px;
    margin: 30px auto;
    padding: 0 15px;
}

.search-section {
    margin-bottom: 25px;
}

.search-bar input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

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

.forum-card {
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
}

.sticky-card {
    border-left: 5px solid var(--nav-bg) !important;
    background-color: #f0f7f7 !important;
    cursor: default;
}

.card-header {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.forum-name { font-weight: bold; color: var(--accent); }
.post-author { color: var(--text-muted); margin-left: 8px; font-style: italic; }
.post-time { color: var(--text-muted); margin-left: 8px; }

.delete-btn {
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.4;
}
.delete-btn:hover { opacity: 1; }

.topic-title { font-size: 1.25rem; margin-bottom: 8px; color: #1a202c; }
.post-preview { color: #4a5568; font-size: 0.95rem; margin-bottom: 12px; }

/* --- FORM CARDS & AUTH --- */
.form-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-card {
    max-width: 450px;
    margin: 0 auto;
}

.form-card input, .form-card textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
}

.form-card textarea { height: 120px; resize: vertical; }

.form-buttons { display: flex; gap: 10px; }
.form-buttons button, .auth-submit, .reply-box button, #back-to-feed-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    background-color: var(--nav-bg);
    color: white;
}

.secondary-btn { background-color: #cbd5e1 !important; color: var(--text-main) !important; }

.divider {
    text-align: center; margin: 10px 0; color: #a0aec0;
    position: relative; font-size: 0.85rem;
}

.google-btn {
    width: 100%; display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px;
    background: white; font-weight: 600; cursor: pointer;
}

/* --- EXPLORE SECTION --- */
.explore-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 20px; }
.explore-card { background: white; border: 1px solid #e2e8f0; padding: 20px; border-radius: 8px; cursor: pointer; }
.explore-card:hover { border-color: var(--nav-bg); }

/* --- REPLIES --- */
.replies-section { margin-top: 30px; background: white; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; }
.reply-item { background: var(--bg-color); padding: 12px; border-radius: 6px; margin-bottom: 10px; }
.reply-box { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
.reply-box textarea { width: 100%; height: 60px; padding: 10px; resize: none; }