/* --- Global Styles & Variables --- */
:root {
    --background: #F0F2F5; --primary: #007BFF; --primary-light: #58A6FF;
    --accent: #17A2B8; --secondary: #6C757D; --text-dark: #212529;
    --text-light: #FFFFFF; --card-bg: #FFFFFF; --nav-bg: #343A40;
    --border: #DEE2E6;
}
body {
    font-family: "Segoe UI", sans-serif; margin: 0; background-color: var(--background);
    color: var(--text-dark); display: flex; justify-content: center;
    align-items: center; min-height: 100vh;
}
#app { width: 100%; height: 100vh; }
.hidden { display: none !important; }

/* --- Auth & Cards --- */
.auth-container { display: flex; justify-content: center; align-items: center; height: 100%; }
.card { background-color: var(--card-bg); padding: 40px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); width: 400px; text-align: center; }
.card h1 { color: var(--primary); font-size: 32px; margin-bottom: 20px; }
.input-group { position: relative; text-align: left; margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-size: 11px; }
input[type="text"], input[type="email"], input[type="password"], textarea, select { width: 100%; padding: 10px; font-size: 14px; border: 1px solid var(--border); border-radius: 4px; box-sizing: border-box; }
button.primary-btn { width: 100%; padding: 12px; font-size: 14px; font-weight: bold; background-color: var(--primary); color: var(--text-light); border: none; border-radius: 4px; cursor: pointer; margin-top: 10px; }
.secondary-link { background: none; border: none; color: var(--primary); text-decoration: underline; cursor: pointer; margin-top: 15px; font-size: 12px; }
.production-credit { font-size: 11px; color: var(--secondary); margin-top: 30px; margin-bottom: -20px; text-align: center; }

/* --- University Suggestions --- */
.suggestions-list { position: absolute; top: 100%; left: 0; right: 0; background-color: white; border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; z-index: 100; max-height: 150px; overflow-y: auto; }
.suggestion-item { padding: 10px; cursor: pointer; }
.suggestion-item:hover { background-color: #f0f0f0; }

/* --- Dashboard --- */
.dashboard-container { display: flex; height: 100vh; width: 100%; }
.nav-sidebar { width: 220px; background-color: var(--nav-bg); color: var(--text-light); display: flex; flex-direction: column; padding: 20px 0; }
.nav-sidebar h1 { font-size: 24px; font-weight: bold; text-align: center; padding: 0 10px 20px 10px; }
.nav-button { background: none; border: none; color: var(--text-light); font-size: 16px; text-align: left; width: 100%; padding: 15px 30px; cursor: pointer; position: relative; }
.nav-button:hover { background-color: var(--secondary); }
.nav-sidebar .logout-button { margin-top: auto; }
.content-area { flex-grow: 1; padding: 40px; overflow-y: auto; }
.content-header { font-size: 28px; font-weight: bold; margin-bottom: 20px; }
.notification-badge {
    position: absolute; top: 50%; right: 20px; transform: translateY(-50%);
    background-color: #dc3545; color: white; width: 22px; height: 22px;
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 12px; font-weight: bold; box-shadow: 0 0 5px rgba(0,0,0,0.3);
}

/* --- Post Card & Profile --- */
.post-card { background-color: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin-bottom: 20px; max-width: 700px; }
.post-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.user-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-author { font-size: 16px; font-weight: bold; }
.post-username { font-size: 14px; color: var(--secondary); }
.post-media img, .post-media video { max-width: 100%; max-height: 400px; border-radius: 4px; margin-top: 10px; display: block; }
.follow-btn { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; color: var(--text-light); background-color: var(--primary); font-size: 14px; font-weight: bold; }
.profile-header { background-color: var(--card-bg); padding: 30px; border-radius: 8px; margin-bottom: 30px; text-align: center; }
.profile-picture-container { position: relative; width: 120px; height: 120px; margin: 0 auto 15px auto; }
.profile-picture-container img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 4px solid var(--card-bg); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
#edit-pfp-btn {
    position: absolute; bottom: 5px; right: 5px; background-color: var(--primary);
    color: white; border: 2px solid var(--card-bg); border-radius: 50%;
    width: 32px; height: 32px; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center; transition: background-color 0.2s;
}
#edit-pfp-btn:hover { background-color: var(--primary-light); }
#profile-follow-btn { padding: 10px 30px; font-weight: bold; width: 150px; margin: 10px auto 0 auto; }
.profile-username { font-size: 16px; color: var(--secondary); margin-top: -10px; margin-bottom: 15px; }
.profile-stats { display: flex; gap: 40px; justify-content: center; margin-top: 20px; }
.stat-item { text-align: center; }
.stat-item .count { font-size: 18px; font-weight: bold; }
.stat-item .label { font-size: 12px; color: var(--secondary); }
.create-post-btn { margin-top: 20px; padding: 10px 20px; font-weight: bold; color: var(--text-light); background-color: var(--primary); border: none; border-radius: 5px; cursor: pointer; }

/* --- Post Actions (Likes) --- */
.post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}
.like-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--secondary);
    transition: transform 0.2s, color 0.2s;
}
.like-btn:hover {
    transform: scale(1.2);
}
.like-btn.active {
    color: #e74c3c;
}
.like-count {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
}

/* --- Feed Search --- */
.search-bar { display: flex; margin-bottom: 20px; gap: 10px; }
.search-bar input { flex-grow: 1; padding: 10px; border: 1px solid var(--border); border-radius: 4px; }
.search-bar button { padding: 10px 20px; background-color: var(--primary); color: white; border: none; border-radius: 4px; cursor: pointer;}
.user-search-result {
    display: flex; align-items: center;
    background-color: var(--card-bg); padding: 15px; border: 1px solid var(--border);
    border-radius: 8px; margin-bottom: 10px;
}
.user-search-pfp { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; margin-right: 15px; }
.user-search-info { display: flex; flex-direction: column; text-align: left; margin-right: auto; }
.user-search-info strong { font-size: 16px; }
.user-search-info span { font-size: 14px; color: var(--secondary); }
.user-search-info small { font-size: 12px; color: var(--secondary); margin-top: 4px; }
.user-search-result .view-profile-btn { width: auto; margin-top: 0; padding: 8px 15px; font-size: 12px;}

/* --- Modal Styles --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background-color: var(--card-bg); padding: 30px; border-radius: 8px; width: 90%; max-width: 500px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
button.secondary-btn { padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-weight: bold; background-color: #e0e0e0; color: var(--text-dark); }

/* --- Chat Styles --- */
.chat-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; cursor: pointer; }
.chat-item:hover { background-color: #e9ecef; }
.chat-window { display: flex; flex-direction: column; height: 80vh; max-height: 600px; }
.chat-messages { flex-grow: 1; overflow-y: auto; border: 1px solid var(--border); padding: 10px; margin-bottom: 15px; border-radius: 4px; }
.message-bubble { max-width: 70%; padding: 10px 15px; border-radius: 18px; margin-bottom: 10px; line-height: 1.4; word-wrap: break-word; }
.message-bubble.sent { background-color: var(--primary); color: white; margin-left: auto; }
.message-bubble.received { background-color: #e9ecef; color: var(--text-dark); }
.chat-input-form { display: flex; gap: 10px; }
.chat-input-form input { flex-grow: 1; }
.chat-input-form button { width: auto; }

/* --- Connections Page --- */
.connections-nav {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.connections-tab-btn {
    padding: 10px 20px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 16px;
    color: var(--secondary);
    border-bottom: 3px solid transparent;
}
.connections-tab-btn.active {
    color: var(--primary);
    border-bottom: 3px solid var(--primary);
}
.connection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: background-color 0.2s;
}
.connection-item:hover {
    background-color: #e9ecef;
}
.connection-info {
    display: flex;
    align-items: center;
    gap: 15px;
}
.connection-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.connection-info div {
    display: flex;
    flex-direction: column;
}
.connection-info strong {
    font-size: 16px;
}
.connection-info span {
    font-size: 14px;
    color: var(--secondary);
}
.connection-actions .primary-btn,
.connection-actions .secondary-btn {
    width: auto;
    margin-top: 0;
    padding: 8px 15px;
    font-size: 12px;
}