@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Lato:wght@400;700&display=swap');

:root {
    --bs-primary: #0A749A;
    --bs-secondary: #2E9599;
    --accent-color: #F2C14E;
    --neutral-light: #F8F9FA;
    --neutral-dark-text: #343A40;
    --neutral-dark-bg: #212529;

    --bs-primary-rgb: 10, 116, 154;
    --bs-secondary-rgb: 46, 149, 153;
    --bs-body-color: var(--neutral-dark-text);
    --bs-body-bg: var(--neutral-light);
    --bs-font-sans-serif: 'Lato', sans-serif;
    --headings-font-family: 'Poppins', sans-serif;
    --bs-border-radius: 0.5rem;
    --bs-border-radius-lg: 0.8rem;
    --bs-border-radius-sm: 0.3rem;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.07);
}

html, body {
    overscroll-behavior: none;
}

body {
    font-family: var(--bs-font-sans-serif);
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    padding-top: 80px; /* Adjust based on final navbar height */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Typographic Scale */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--headings-font-family);
    font-weight: 700;
    color: var(--neutral-dark-text);
}

h1 { font-size: 2.5rem; margin-bottom: 2rem; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.75rem; margin-bottom: 1.5rem; }
p { font-size: 1rem; line-height: 1.6; margin-bottom: 1rem; }
small { font-size: 0.875rem; }

/* Shared Components Styling */

/* Frosted Glass Navbar */
.navbar-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700;
    font-size: 1.5rem;
    color: #34495E !important;
}

.nav-link {
    font-family: 'Open Sans', sans-serif;
    font-weight: 500;
    color: #34495E !important;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #8E44AD !important;
}

#logout-link {
    color: #dc3545 !important;
}

#logout-link:hover {
    color: #a71d2a !important;
}

/* Button Styling */
.btn {
    border-radius: var(--bs-border-radius);
    padding: 0.6rem 1.5rem;
    font-weight: 700;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background-image: linear-gradient(to right, var(--bs-primary) 0%, var(--bs-secondary) 100%);
    color: var(--neutral-light);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #fff;
}

.btn-outline-primary {
    color: var(--bs-primary);
    border: 2px solid var(--bs-primary);
}

.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    color: var(--neutral-light);
}

.btn-secondary {
    background-color: var(--bs-secondary);
    color: var(--neutral-light);
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Conditional Auth View Styles */
body.logged-in .logged-out-view {
  display: none !important;
}

body.logged-in .logged-in-view {
  display: flex !important;
}

/* Footer Styling */
.site-footer {
    background-color: #212529;
    color: #F8F9FA;
    padding: 2rem 0;
    margin-top: auto;
}

.site-footer a {
    color: #F2C14E;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #F8F9FA;
    text-decoration: underline;
}

/* Preserved Node-Specific Styles */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--bs-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 3.2rem; font-weight: 700; margin-bottom: 2rem; }
h2 { font-size: 2.5rem; font-weight: 600; margin-bottom: 1.5rem; }
h3 { font-size: 1.75rem; font-weight: 600; margin-bottom: 1rem; }
p { font-size: 1rem; font-weight: 400; line-height: 1.6; margin-bottom: 1rem; }
small { font-size: 0.875rem; font-weight: 400; }

.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.card-body {
    padding: 2rem;
}

.form-label {
    font-weight: 600;
    color: var(--bs-dark-text);
    margin-bottom: 0.5rem;
}

.form-control {
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--bs-secondary);
    box-shadow: 0 0 0 4px rgba(142, 68, 173, 0.1);
    background-color: #fff;
}

.table {
    --bs-table-bg: transparent;
    color: var(--bs-dark-text);
}

.table thead th {
    border-bottom: 2px solid rgba(0,0,0,0.05);
    font-weight: 600;
    color: var(--bs-primary);
    padding: 1rem;
}

.table tbody td {
    border-bottom: 1px solid rgba(0,0,0,0.03);
    padding: 1.25rem 1rem;
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.stock-price {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--bs-accent);
}

.stock-symbol {
    font-weight: 700;
    color: var(--bs-secondary);
    background: rgba(142, 68, 173, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.post-card-summary {
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 1.5rem;
}

/* Clickable stock card styling */
.stock-card-link {
    display: block;
    color: inherit;
}

.stock-card-link .card-title {
    color: var(--bs-primary);
}

.stock-card-link:hover .card-title {
    color: #8E44AD;
}

/* Follow button styling */
.follow-stock-btn.btn-outline-secondary {
    border: 1px solid #dee2e6;
    color: #6c757d;
}

.follow-stock-btn.btn-outline-secondary:hover {
    border-color: #6c757d;
    background-color: #f8f9fa;
}

/* Light red unfollow button */
.btn-outline-danger-light {
    border: 1px solid #f5c6cb;
    color: #dc3545;
    background-color: transparent;
}

.btn-outline-danger-light:hover {
    border-color: #dc3545;
    background-color: #dc3545;
    color: #fff;
}

/* Stock tag link styling (pill/badge style) */
.stock-tag-link {
    display: inline-block;
    background-color: rgba(26, 188, 156, 0.1);
    color: #1abc9c;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.stock-tag-link:hover {
    background-color: rgba(26, 188, 156, 0.25);
    color: #1abc9c;
    text-decoration: none;
}

/* Clickable post card styling */
.post-card-link {
    display: block;
    color: inherit;
}

.post-card-link .card-title {
    color: var(--bs-primary);
}

.post-card-link:hover .card-title {
    color: #8E44AD;
}

/* Author link styling */
.author-link {
    color: var(--bs-body-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-link:hover {
    color: var(--bs-secondary);
    text-decoration: underline;
}