/* ========================================
    ShopAtSight - Main Stylesheet
    NEW: Now includes Day/Night Themes
    ========================================
*/

/* --- 1. THEME DEFINITIONS --- */

/* :root defines the DEFAULT theme (Night Mode) */
:root {
    --primary-color: #00C49A;
    --primary-dark: #00a07c;
    --dark-bg: #000000;
    --content-bg: #1a1a1a;
    --content-bg-light: #2a2a2a;
    --border-color: #333333;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --danger: #ff453a;
    --success: #34c759;
    --warning: #ff9f0a;
    --info: #0a84ff;
    --logo-filter: brightness(0) invert(1); /* Makes logo white */
}

/* body.light-theme defines the LIGHT theme */
body.light-theme {
    --primary-color: #008f7a; /* Darker green for contrast on white */
    --primary-dark: #007a67;
    --dark-bg: #f4f4f5; /* Light gray page background */
    --content-bg: #ffffff; /* White content background */
    --content-bg-light: #f9f9f9; /* Slightly off-white */
    --border-color: #e4e4e7; /* Light gray border */
    --text-primary: #18181b; /* Almost black */
    --text-secondary: #71717a; /* Medium gray */
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --info: #2563eb;
    --logo-filter: none; /* Use original logo color */
}


/* --- 2. Global & Font Setup --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    /* Uses CSS variables */
    background-color: var(--dark-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

* {
    box-sizing: border-box;
}

/* --- 3. Main App Layout --- */
.app-container {
    width: 100%;
    max-width: 500px; /* Mobile-first container */
    margin: 0 auto;
    background-color: var(--content-bg); /* Main content bg */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    overflow-x: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.main-content {
    flex-grow: 1;
    padding: 20px 15px;
    overflow-y: auto;
}

/* --- 4. Header & Footer --- */
.app-header {
    height: 60px;
    background-color: var(--content-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.header-left, .header-right {
    flex: 1;
    display: flex;
    align-items: center;
}
.header-center { flex: 2; text-align: center; }
.header-right { justify-content: flex-end; }

.header-back {
    color: var(--text-primary);
}

.logo-link {
    display: inline-block;
    height: 100%;
    display: flex;
    align-items: center;
}
.logo-image {
    height: 30px; /* Adjust height as needed */
    width: auto;
    filter: var(--logo-filter); /* Applies the theme filter */
}

.header-auth {
    display: flex;
    align-items: center;
}
.header-auth a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-left: 15px;
}
.header-auth a.btn-signup {
    background-color: var(--primary-color);
    color: var(--dark-bg);
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
}
body.light-theme .header-auth a.btn-signup {
    color: var(--text-primary);
}
.header-auth .profile-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 15px;
    border: 1px solid var(--border-color);
}
/* NEW: Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
    height: 32px;
    width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-toggle-btn:hover {
    color: var(--text-primary);
}
/* Hide one icon based on theme */
.theme-toggle-btn .sun-icon { display: none; }
body.light-theme .theme-toggle-btn .sun-icon { display: block; }
body.light-theme .theme-toggle-btn .moon-icon { display: none; }


.app-footer {
    height: 65px;
    background-color: var(--content-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: sticky;
    bottom: 0;
    z-index: 100;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.footer-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    flex-grow: 1;
    padding: 5px 0;
}
.footer-link svg {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
}
.footer-link.active {
    color: var(--primary-color);
}
.legal-footer {
    text-align: center;
    padding: 15px;
    font-size: 12px;
    color: var(--text-secondary);
    background-color: #0c0c0c; /* Stays dark for contrast */
}
body.light-theme .legal-footer {
    background-color: #e4e4e7;
}
.legal-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}
.legal-footer a:hover {
    color: var(--text-primary);
}


/* --- 5. Home Page (Slider, Search, Feed) --- */
.slider-container {
    width: 100%;
    aspect-ratio: 16 / 7; /* Wide banner */
    background-color: var(--content-bg-light);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    border: 1px solid var(--border-color);
}
.slider-container img,
.slider-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.text-search-form {
    display: flex;
    margin-bottom: 15px;
    position: relative;
}
.text-search-input {
    flex-grow: 1;
    height: 50px;
    padding: 0 50px 0 50px; /* space for icon and button */
    font-size: 16px;
    border: 1px solid var(--border-color);
    background-color: var(--content-bg-light);
    border-radius: 10px;
    color: var(--text-primary);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.text-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}
.text-search-form .search-icon {
    position: absolute;
    left: 15px;
    top: 13px;
    color: var(--text-secondary);
    pointer-events: none;
}
.text-search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    height: 40px;
    width: 40px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: var(--dark-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
body.light-theme .text-search-btn {
    color: var(--text-primary);
}

.home-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    margin: 25px 0;
}
.home-divider::before,
.home-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}
.home-divider:not(:empty)::before { margin-right: .25em; }
.home-divider:not(:empty)::after { margin-left: .25em; }

.upload-options {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}
.upload-btn {
    flex: 1;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.upload-btn.snap {
    background-color: var(--primary-color);
    color: var(--dark-bg);
}
body.light-theme .upload-btn.snap {
    color: var(--text-primary);
}
.upload-btn.upload {
    background-color: var(--content-bg-light);
    color: var(--text-primary);
}
.upload-btn input[type="file"] {
    display: none;
}
.upload-btn svg { width: 24px; height: 24px; }

/* --- 6. Social Feed (Home) --- */
.feed-container {
    margin: 30px -15px 0 -15px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.feed-item {
    display: flex;
    margin-bottom: 20px;
    padding-bottom: 20px;
    padding-left: 15px;
    padding-right: 15px;
    border-bottom: 1px solid var(--border-color);
}
.feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}
.feed-content {
    flex: 1;
}
.feed-header {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.feed-header strong {
    color: var(--text-primary);
    text-decoration: none;
}
.feed-header a:hover {
    text-decoration: underline;
}
.feed-product-preview {
    display: flex;
    background-color: var(--content-bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    text-decoration: none;
}
.feed-product-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 12px;
}
.feed-product-info {
    flex: 1;
}
.feed-product-info h4 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    margin: 0 0 4px 0;
}
.feed-product-info p {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0;
}
body.light-theme .feed-product-info p {
    color: #fff; /* White text on dark green */
}

/* --- 7. Auth Pages (Login / Register) --- */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 0;
}
.auth-container h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 25px;
}
.auth-tabs {
    display: flex;
    background-color: var(--content-bg-light);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 25px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}
.auth-tab.active {
    background-color: var(--border-color);
    color: var(--text-primary);
}
body.light-theme .auth-tab.active {
    background-color: #ddd;
}
.auth-tab-content {
    display: none;
}
.auth-tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-group input {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--content-bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}
.submit-button {
    background-color: var(--primary-color);
    color: var(--dark-bg);
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.submit-button:hover {
    background-color: var(--primary-dark);
}
body.light-theme .submit-button {
    color: var(--text-primary);
}
.social-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    margin: 25px 0;
}
.social-divider::before, .social-divider::after {
    content: ''; flex: 1; border-bottom: 1px solid var(--border-color);
}
.social-divider:not(:empty)::before { margin-right: .5em; }
.social-divider:not(:empty)::after { margin-left: .5em; }

.social-login { display: flex; flex-direction: column; gap: 10px; }
.social-btn {
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid var(--border-color);
}
.social-btn svg { width: 20px; height: 20px; margin-right: 10px; }
.social-btn.google { background: #4285F4; color: #fff; border: none; }
.social-btn.facebook { background: #1877F2; color: #fff; border: none; }
.social-btn.apple { background: #000000; color: #fff; border: 1px solid #fff; }
body.light-theme .social-btn.apple { background: #000; color: #fff; border: none; }

.auth-links {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-secondary);
}
.auth-links a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

.error-msg {
    background-color: rgba(255, 69, 58, 0.1);
    color: var(--danger);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    border: 1px solid var(--danger);
}
.success-msg {
    background-color: rgba(52, 199, 89, 0.1);
    color: var(--success);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    border: 1px solid var(--success);
}
.info-msg {
    background-color: rgba(10, 132, 255, 0.1);
    color: var(--info);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-weight: 500;
    border: 1px solid var(--info);
}


/* --- 8. Crop Page --- */
body.crop-page-lock {
    overflow: hidden;
    position: fixed; /* Prevents bounce */
    width: 100%;
    height: 100%;
}
.crop-page-lock .app-footer {
    display: none;
}
.crop-page-lock .main-content {
    display: flex;
    flex-direction: column;
    padding: 0 !important; 
    overflow: hidden; 
    position: relative; /* Context for children */
    flex-grow: 1;
}
.img-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}
.img-container img {
    max-width: 100%;
    max-height: 100%;
}
.crop-prompt {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    padding: 20px;
    text-align: center;
    color: var(--text-primary);
    font-size: 15px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0));
    pointer-events: none;
}
.crop-footer {
    position: fixed; 
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto; 
    max-width: 500px; /* Match the .app-container max-width */
    z-index: 10;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    border-top: none;
}
.cropper-view-box,
.cropper-face {
    outline: 2px dashed var(--primary-color);
    outline-offset: -2px;
}
.cropper-modal { background-color: #000; opacity: 0.7; }

/* --- 9. Results & Product Card --- */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.cropped-image-preview {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.cropped-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.col-span-2 {
    grid-column: span 2 / span 2;
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}
.product-card-container {
    text-decoration: none;
    position: relative;
}
.product-card {
    text-decoration: none;
    background-color: var(--content-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
body.light-theme .product-card {
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: var(--content-bg-light);
}
.product-info { padding: 12px; }
.product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 4px 0;
}
.product-retailer, .product-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.seller-logo-small {
    height: 20px;
    max-width: 60px;
    object-fit: contain;
    align-self: flex-start;
    /* Invert logo on dark mode if it's not a PNG */
    filter: var(--logo-filter);
}
.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}
.save-find-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    color: var(--text-primary);
}
.save-find-btn.active {
    background-color: var(--primary-color);
    color: var(--dark-bg);
}
.save-find-btn svg { width: 20px; height: 20px; }

/* --- 10. Star Ratings & Reviews --- */
.star-rating-display { color: #555; }
.star-rating-display .filled { color: #f5c518; }
.star-rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; }
.star-rating-input input { display: none; }
.star-rating-input label {
    font-size: 30px;
    color: #555;
    cursor: pointer;
    padding: 0 2px;
}
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
    color: var(--primary-color);
}
.review-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}
.review-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.review-form textarea {
    width: 100%;
    height: 80px;
    padding: 10px;
    background-color: var(--content-bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
}
.review-list { display: flex; flex-direction: column; gap: 15px; }
.review-item {
    display: flex;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
.review-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.review-content strong { color: var(--text-primary); font-weight: 600; }
.review-content strong a { color: inherit; text-decoration: none; }
.review-content strong a:hover { text-decoration: underline; }
.review-content p { color: #ccc; margin: 4px 0; }
body.light-theme .review-content p { color: #333; }
.review-content small { color: var(--text-secondary); }

/* --- 11. Product Comparison Page --- */
.product-page-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    background-color: var(--content-bg-light);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}
.product-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.product-page-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.product-page-description {
    font-size: 15px;
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
}
body.light-theme .product-page-description { color: #333; }

.product-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    background-color: var(--content-bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
}
.action-btn.active, .action-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.action-btn svg { width: 20px; height: 20px; }
.action-btn.share { color: var(--info); border-color: var(--info); }
.action-btn.alert { color: var(--warning); border-color: var(--warning); }
.action-btn.alert.active {
    background-color: var(--warning);
    color: var(--dark-bg);
}
body.light-theme .action-btn.alert.active {
    color: var(--text-primary);
}

.seller-list-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 30px 0 15px 0;
}
.seller-list { display: flex; flex-direction: column; gap: 1px; }
.seller-row {
    display: grid;
    grid-template-columns: 1fr 1fr 80px;
    align-items: center;
    padding: 15px;
    background-color: var(--content-bg-light);
    border: 1px solid var(--border-color);
}
.seller-row:first-of-type { border-radius: 8px 8px 0 0; }
.seller-row:last-of-type { border-radius: 0 0 8px 8px; border-bottom: 1px solid var(--border-color); }
.seller-logo {
    height: 30px;
    max-width: 100px;
    object-fit: contain;
    justify-self: start;
    filter: var(--logo-filter); /* Makes logos white on dark bg */
}
.seller-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}
.seller-buy-btn {
    padding: 8px 12px;
    background-color: var(--primary-color);
    color: var(--dark-bg);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border-radius: 6px;
    text-align: center;
}
body.light-theme .seller-buy-btn {
    color: var(--text-primary);
}
.seller-buy-btn:hover {
    background-color: var(--primary-dark);
}

/* --- 12. Dashboard / Profile Page --- */
.profile-header {
    position: relative;
    height: 220px;
    background-color: var(--content-bg-light);
}
.banner-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background-color: #333;
}
.avatar-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--content-bg);
    position: absolute;
    bottom: 0;
    left: 15px;
}
body.light-theme .avatar-image {
    border-color: var(--content-bg);
}
.profile-upload-form {
    position: absolute;
}
.profile-upload-input {
    display: none;
}
.profile-upload-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background-color: rgba(26, 26, 26, 0.8);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
}
body.light-theme .profile-upload-btn {
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
}
.profile-info {
    padding: 15px;
}
.profile-info h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.profile-info p {
    font-size: 14px;
    color: #ccc;
    margin: 8px 0 0 0;
    line-height: 1.5;
}
body.light-theme .profile-info p { color: #333; }
#bio-text { cursor: pointer; }
.profile-stats {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}
.stat-item {
    font-size: 14px;
    color: var(--text-secondary);
}
.stat-item strong {
    font-weight: 600;
    color: var(--text-primary);
}
.dashboard-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin: 0 -15px 20px -15px;
    padding: 0 15px;
    overflow-x: auto;
}
.dash-tab {
    padding: 12px 10px;
    margin-right: 15px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.dash-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
}
.dash-tab-content { display: none; }
.dash-tab-content.active { display: block; }

.activity-header {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}
.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}
.activity-item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    align-items: center;
}
.activity-item img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background-color: var(--content-bg-light);
}
.activity-item-text {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background-color: var(--content-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.activity-item span {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 80px;
    text-align: center;
}
.social-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.social-column h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}
.social-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.social-column li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}
.social-user-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}
.social-user-link img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.social-user-link span {
    font-weight: 500;
    color: var(--text-primary);
}
.btn-follow {
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--primary-color);
    background-color: var(--primary-color);
    color: var(--dark-bg);
    border-radius: 6px;
    cursor: pointer;
}
.btn-follow.following {
    background-color: transparent;
    color: var(--primary-color);
}
body.light-theme .btn-follow {
    color: var(--text-primary);
}
body.light-theme .btn-follow.following {
    color: var(--primary-color);
}


/* --- 13. Utility & Loaders --- */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
body.light-theme .page-loader {
    background: rgba(255, 255, 255, 0.85);
}
.page-loader h2 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-top: 1rem;
}
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 14. Camera Modal (Snap Button) --- */
.camera-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 200;
    display: flex;
    flex-direction: column;
}
.camera-header {
    flex-shrink: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    background-color: #1a1a1a;
}
.camera-title {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}
.camera-close-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
}
.camera-video {
    width: 100%;
    flex-grow: 1;
    object-fit: cover;
}
.camera-error-message {
    position: absolute;
    top: 60px;
    bottom: 90px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    color: #fff;
    background-color: rgba(0,0,0,0.8);
}
.camera-error-message p {
    margin: 5px 0;
}
.camera-footer {
    flex-shrink: 0;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
}
.camera-snap-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #fff;
    border: 4px solid var(--dark-bg);
    box-shadow: 0 0 0 2px #fff;
    cursor: pointer;
}
.camera-snap-button span {
    display: none; /* Hide text, it's a visual button */
}