/* ==========================================
   STYLE.CSS
   Global styles for Trussloop
   Covers:
   1.  Reset & Base
   2.  App Shell & Container
   3.  Login / Signup Page
   4.  Input Groups & Buttons
   5.  Home Feed Header & Search
   6.  Post Cards
   7.  Bottom Navigation
   8.  Reply Link
   9.  Profile Page (Customer)
   10. Post Page (Create / Edit)
   11. Error & Help Text
========================================== */


/* ==========================================
   1. RESET & BASE
   Universal reset + body defaults
========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f9;
    min-height: 100vh;
}

/* Mobile app container — centers content on large screens */
.app-shell {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    min-height: 100vh;
    background: #F8F9FD;
}


/* ==========================================
   2. LOGIN / SIGNUP PAGE
   Centered card layout used on login.html
   and signup.html
========================================== */

.container {
    width: 100%;
    max-width: 400px;
    text-align: center;
    padding: 20px;
    margin: 0 auto;
}

.header {
    margin-bottom: 30px;
}

.logo {
    color: #4a76bc;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.tagline {
    color: #555;
    font-size: 0.9rem;
}

.login-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
}

.login-card h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #333;
}

/* Signup heading — "Sign Up as Customer / as Service Provider" */
#signupTitle {
    margin-bottom: 20px;
}


/* ==========================================
   3. INPUT GROUPS & BUTTONS
   Shared across login, signup, post, replies
========================================== */

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #444;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fafafa;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    border-color: #4a76bc;
    background-color: #fff;
}

/* Working hours time picker row */
.hours-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hours-row input[type="time"] {
    flex: 1;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
    font-family: inherit;
}

.btn-primary {
    background-color: #4a76bc;
    color: white;
}

.btn-primary:hover {
    background-color: #3a5d96;
}

.btn-secondary {
    background-color: #eef3f8;
    color: #4a76bc;
    border: 1px solid #d0dae5;
}

/* OR divider line between login and guest options */
.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: #ddd;
}

.divider span {
    background: #fff;
    padding: 0 10px;
    color: #888;
    position: relative;
    font-size: 0.8rem;
}

.footer-text {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #666;
}

.footer-text a {
    color: #4a76bc;
    text-decoration: none;
    font-weight: bold;
}

/* Inline error message shown below a specific field */
.error-banner {
    color: #ef4444;
    font-size: 0.85rem;
    margin-bottom: 10px;
    display: none;
}

.error-banner.visible {
    display: block;
}


/* ==========================================
   4. HOME FEED HEADER & SEARCH
   Blue header + search bar on home.html
   and seller-feed.html
========================================== */

/* Override body background for feed pages */
.home-body {
    display: block;
    background-color: #f4f7f9;
    padding-bottom: 70px;
}

.home-header {
    background-color: #4a76bc;
    color: white;
    padding: 20px;
    text-align: center;
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 5px;
}

.logo-white {
    font-size: 2rem;
    font-weight: bold;
}

.search-icon-top {
    position: absolute;
    right: 0;
    font-size: 1.2rem;
}

.home-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 15px;
}

/* Search bar + filter button row */
.search-section {
    margin-bottom: 20px;
}

.search-bar {
    background: white;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.search-bar input {
    border: none;
    outline: none;
    margin-left: 10px;
    width: 100%;
    font-family: inherit;
}

.btn-ask {
    width: 100%;
    background-color: #4a76bc;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}


/* ==========================================
   5. POST CARDS
   Used on home feed, profile, seller feed
========================================== */

.post-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

/* Circular avatar image */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-info {
    flex-grow: 1;
}

.username {
    display: block;
    font-weight: bold;
    font-size: 0.95rem;
}

.location {
    font-size: 0.8rem;
    color: #777;
}

.post-content {
    font-size: 0.95rem;
    margin-bottom: 10px;
    color: #333;
}

.post-images {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.post-images img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
}

/* Product / model number tags */
.tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.tag {
    background: #eef3f8;
    color: #4a76bc;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
}

.post-footer {
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 10px;
}


/* ==========================================
   6. BOTTOM NAVIGATION
   Fixed tab bar at bottom of all main pages
========================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

.nav-item {
    text-align: center;
    color: #888;
    font-size: 0.8rem;
    cursor: pointer;
    text-decoration: none;
}

.nav-item i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.nav-item.active {
    color: #4a76bc;
}

/* Blue circle post button in center of bottom nav */
.center-post {
    background: #4f6df5;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    margin-top: -18px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}


/* ==========================================
   7. REPLY LINK
   "N Replies" link in post card footer
========================================== */

.reply-link {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.reply-link:hover {
    color: #007bff;
    text-decoration: none;
}


/* ==========================================
   8. CUSTOMER PROFILE PAGE
   Classes used on profile.html
========================================== */

body.profile-page {
    background-color: #F8F9FD;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    padding: 0;
}

body.profile-page .app-shell {
    width: 100%;
    max-width: 420px;
    background: #f4f7f9;
}

/* Blue gradient header banner */
.header-bg {
    height: 180px;
    background: linear-gradient(180deg, #365E9D 0%, #4A76BC 60%, #7EA0D9 100%);
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
}

/* Avatar overlapping the header */
.avatar-box {
    margin-bottom: -55px;
    display: block;
}

.profile-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    object-fit: cover;
}

/* Scrollable content below the header */
.content-wrapper {
    padding: 70px 20px 100px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.user-details h1 { font-size: 26px; font-weight: 700; color: #333; }
.user-details p  { color: #666; font-size: 14px; margin-bottom: 25px; }

/* Stats row: Posts count, Replies count */
.stats-container {
    background: white;
    display: flex;
    border-radius: 20px;
    border: 1px solid #eee;
    margin-bottom: 25px;
}

.stat-unit {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 5px;
    gap: 10px;
    text-align: left;
}

.br-divider { border-right: 1px solid #eee; }
.stat-unit i { color: #4A76BC; font-size: 18px; }
.small-label  { display: block; font-size: 11px; color: #888; }
.big-val      { font-weight: 700; font-size: 15px; }

/* "Recent Activity" heading */
.section-heading { text-align: left; font-size: 16px; margin-bottom: 15px; width: 100%; }

/* Each post in the activity list */
.activity-row {
    background: white;
    padding: 12px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    border: 1px solid #eee;
    text-align: left;
}

.icon-square {
    width: 45px;
    height: 45px;
    background: #f1f3f8;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.text-info         { flex: 1; padding-left: 15px; }
.text-info h4      { font-size: 14px; color: #333; }
.text-info p       { font-size: 12px; color: #888; }
.arrow-gray        { color: #ccc; font-size: 12px; }

/* Red logout button */
.btn-red-logout {
    width: 100%;
    padding: 16px;
    border-radius: 15px;
    border: none;
    background: #FF4757;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}


/* ==========================================
   9. POST PAGE (CREATE / EDIT)
   post.html — card-style form
========================================== */

body.post-page-wrapper {
    background-color: #f4f7fa;
    margin: 0;
    padding: 40px 20px;
    display: flex;
    justify-content: center;
}

/* The form card */
.form-container {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: left;
    width: 100%;
    max-width: 450px;
    box-sizing: border-box;
}

/* Page heading with blue underline accent */
.form-title {
    font-size: 1.55rem;
    color: #1a202c;
    font-weight: 700;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-title::after {
    content: "";
    display: block;
    width: 35px;
    height: 3px;
    background-color: #4a76bc;
    border-radius: 5px;
    margin-top: 8px;
}

/* Blue submit button used on post page */
.btn-primary-blue {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #4a76bc;
    color: white;
    margin-top: 10px;
    transition: background 0.3s ease;
    font-family: inherit;
}

.btn-primary-blue:hover {
    background-color: #3a5d96;
}

/* Image upload area */
.image-upload-container {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.image-upload-container input[type="file"] {
    width: 50%;
    font-size: 0.8rem;
    color: #64748b;
    background: #f8fafc;
    padding: 8px;
    border-radius: 6px;
    border: 1px dashed #cbd5e1;
}

/* Helper text below image upload */
.input-help {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-top: 4px;
}