/* /css/style.css */

:root {
    /* Relaxing Blue & Modern Neutral Palette */
    --bg-color: #F7FAFC; /* Softer, lighter background */
    --surface-color: #FFFFFF;
    --text-main: #2D3748;
    --text-muted: #718096;
    --brand-blue: #3182CE;
    --brand-blue-hover: #2B6CB0;
    --brand-blue-light: #EBF8FF;
    --error-red: #E53E3E;
    --success-green: #38A169;
    --success-bg: #C6F6D5;
    --border-color: #E2E8F0;
    
    /* Layout & Styling Metrics */
    --border-radius-sm: 6px;
    --border-radius-md: 12px;
    --border-radius-full: 9999px;
    --spacing-unit: 1rem;
    
    /* Modern Depth */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* --- Global Navigation (Sticky Top) --- */
header {
    width: 100%;
    background: var(--surface-color);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h2 {
    color: var(--brand-blue);
    font-size: 1.5rem;
    margin: 0;
    letter-spacing: -0.5px;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.25rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--brand-blue);
}

nav a.active {
    color: var(--brand-blue);
    font-weight: 700;
}

/* --- Main Content Containers --- */
main, .auth-container {
    width: 100%;
    max-width: 600px;
    padding: calc(var(--spacing-unit) * 2);
    margin-top: 1.5rem;
    margin-bottom: 3rem;
}

.auth-container {
    max-width: 400px;
    background: var(--surface-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    margin-top: 4rem;
}

h1, h3 {
    color: var(--text-main);
    margin-bottom: 1rem;
}

/* --- Forms, Inputs & Buttons --- */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background-color: #FDFDFD;
    transition: all 0.2s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
    background-color: var(--surface-color);
}

/* Specific form input class for the profile page */
.form-input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.2);
    background-color: #ffffff;
}

/* Specific styling for the Feed "What's on your mind" box */
.feed-textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 90px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.feed-textarea:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(49, 130, 206, 0.2);
    background-color: #ffffff;
}

button {
    background-color: var(--brand-blue);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover:not(:disabled) {
    background-color: var(--brand-blue-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

button:disabled {
    background-color: var(--border-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* --- Feed & Posts Styling --- */
.post-box {
    background: var(--surface-color);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.post {
    background: var(--surface-color, #ffffff);
    padding: 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.post:hover {
    box-shadow: var(--shadow-md);
}

.post-header {
    background: #EDF2F7;
    padding: 1rem 1.25rem;
    margin: -1.25rem -1.25rem 1rem -1.25rem; 
    border-radius: 8px 8px 0 0; 
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
}

.post-header strong {
    font-size: 1.05rem;
}

.post-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.post-content {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: #2D3748;
}

.post-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    display: flex;
    gap: 1.5rem;
}

.like-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0;
    width: auto;
    font-size: 0.9rem;
}

.like-btn:hover {
    background: none;
    color: var(--brand-blue);
    transform: none;
    box-shadow: none;
}

.comments-list {
    margin-top: 1rem;
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
}

/* --- Alerts & Utilities --- */
.success-msg { 
    color: var(--success-green); 
    background: var(--success-bg); 
    padding: 0.75rem 1rem; 
    border-radius: var(--border-radius-sm); 
    margin-bottom: 1rem; 
    font-weight: 500;
    border: 1px solid #9AE6B4;
}

.error-msg { 
    color: var(--error-red); 
    background: #FED7D7;
    padding: 0.75rem 1rem; 
    border-radius: var(--border-radius-sm); 
    margin-bottom: 1rem; 
    font-weight: 500;
    border: 1px solid #FEB2B2;
}

.text-center { text-align: center; }

/* Dashboard Status Cards */
.status-card {
    background: var(--brand-blue-light);
    padding: 1.5rem;
    border-radius: var(--border-radius-md);
    margin-bottom: 2rem;
    border: 1px solid #bee3f8;
}

/* --- Custom File Upload Styling --- */
.hidden-file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: var(--surface-color);
    color: var(--brand-blue);
    border: 2px dashed var(--brand-blue);
    border-radius: var(--border-radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.file-upload-label:hover {
    background-color: var(--brand-blue-light);
    transform: translateY(-1px);
}

.file-name-display {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
    display: block;
}

/* --- Comment Thread Styling --- */
.comment-item {
    font-size: 0.85rem;
    margin-top: 0.75rem; /* Space between comments */
    padding: 0.5rem 0.75rem;
    background: #F7FAFC;
    border-radius: 0 4px 4px 0;
    border-left: 3px solid var(--brand-blue); /* The branding blue line */
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
}

/* The Dark Overlay */
.modal-backdrop {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensures it stays above the map and feed */
}

/* Utility class to easily hide/show via JavaScript */
.hidden {
    display: none !important;
}

/* The White Popup Box */
.modal-box {
    background: #fff;
    width: 90%;
    max-width: 400px; /* Keeps it looking good on desktop */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #ddd;
    width: 100%;
    box-sizing: border-box;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

/* Base state for the X button */
.close-btn {
    background: transparent !important;
    border: none !important;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555 !important;
    padding: 0 5px !important;
    margin: 0 !important;
    line-height: 1;
    width: auto !important;
    box-shadow: none !important;
}

/* Nuke the global button hover styles */
.close-btn:hover,
.close-btn:focus,
.close-btn:active {
    background: transparent !important;
    color: #000 !important; /* Darkens the X slightly for visual feedback */
    transform: none !important; /* Prevents it from jumping */
    box-shadow: none !important;
    outline: none !important;
}

/* Scrollable Container for Users */
.modal-body {
    max-height: 350px;
    overflow-y: auto; /*.close-btn {
    background: transparent !important;
    border: none !important;
    font-size: 1.5rem;
    cursor: pointer;
    color: #555;
    padding: 0 !important;
    margin: 0;
    line-height: 1;
    width: auto !important;
} Adds a scrollbar only if the list is long */
    padding: 10px;
}

/* Styling for the dynamic rows JS will inject */
.like-user-row {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.like-user-row img {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Makes the avatar circular */
    margin-right: 15px;
    object-fit: cover;
}

.like-user-row a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

/* Mentions Dropdown UI */
.mention-dropdown {
    position: absolute;
    top: 100%; /* Snaps it right below the text area */
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px; /* Rounds the bottom corners */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.mention-item:last-child {
    border-bottom: none;
}

.mention-item:hover {
    background-color: #EBF8FF; /* Matches your light blue hover states */
}

.mention-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--brand-blue);
}

/* For the who to follow sidebar */
@media (min-width: 850px) {
    .feed-layout-container {
        grid-template-columns: 2fr 1fr !important;
    }
}