/* assets/css/components.css */

/* Buttons */
.btn-primary-custom {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}
.btn-primary-custom:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline-custom {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}
.btn-outline-custom:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Cards */
.card-custom {
    background: var(--paper-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}
.card-custom:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

/* Verification Badge */
.verified-badge {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-left: 4px;
}

/* Rating */
.rating-star { color: var(--warning-color); }
.rating-text { font-weight: 600; margin-left: 4px; }
.review-count { color: var(--text-muted); font-size: 0.875rem; margin-left: 4px; }

/* Nav */
.navbar-custom {
    background: var(--paper-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}
.navbar-custom .nav-link {
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--primary-color);
}
.brand-logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--dark-color);
}
.brand-logo i {
    color: var(--primary-color);
}

/* Forms */
.form-control-custom {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
}
.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 82, 186, 0.1);
}

/* Feed Post */
.feed-post {
    background: var(--paper-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}
.feed-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
.feed-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    margin-right: 12px;
}
.feed-meta .business-name {
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
    font-size: 1rem;
}
.feed-meta .post-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}
.feed-content {
    padding: 16px;
    font-size: 0.95rem;
}
.feed-media img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}
.feed-actions {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}
.feed-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.feed-btn:hover {
    background: var(--light-color);
    color: var(--dark-color);
}
.feed-btn i { margin-right: 6px; font-size: 1.1rem; }


/* =========================================
   MOBILE FEED FIXES & HIGHLIGHTED ACTION CTAS
   ========================================= */

/* Strict Box Model & Mobile Overflow Protection */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
}

body {
    max-width: 100%;
    position: relative;
}

/* Feed Post Strict Bounding */
.feed-post {
    background: var(--paper-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.feed-header {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.feed-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.feed-meta {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.feed-meta .business-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-size: 1rem;
    line-height: 1.25;
}

.feed-meta .post-time {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
    margin: 0;
}

.feed-content {
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.feed-content p {
    margin: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.feed-media {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #000;
}

.feed-media img, .feed-media video {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    display: block;
}

/* Highlighted Action Buttons (Call & WhatsApp Primary, Others Secondary) */
.feed-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.feed-actions-primary {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.feed-actions-secondary {
    display: flex;
    gap: 0.4rem;
    width: 100%;
}

/* =========================================
   Unified Post Card Footer & Modern CTAs
   ========================================= */
.feed-card-footer {
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    padding: 10px 14px 10px;
    border-radius: 0 0 16px 16px;
    box-sizing: border-box;
    width: 100%;
}

.feed-cta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.feed-cta-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.feed-cta-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 576px) {
    .feed-cta-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .feed-cta-grid.cols-3 {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .feed-cta-grid.cols-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Business Profile Top 4 Uniform Action Buttons */
.bp-top-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(112px, auto));
    gap: 8px;
    align-items: stretch;
}
@media (max-width: 767.98px) {
    .bp-top-actions {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
    }
}
.bp-action-btn {
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none !important;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
}
.bp-action-call {
    background: linear-gradient(135deg, #E65100 0%, #D84315 100%);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 3px 8px rgba(216, 67, 21, 0.25);
}
.bp-action-call:hover {
    background: linear-gradient(135deg, #D84315 0%, #BF360C 100%);
    transform: translateY(-1px);
}
.bp-action-wa {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 3px 8px rgba(37, 211, 102, 0.25);
}
.bp-action-wa:hover {
    background: linear-gradient(135deg, #22BF5B 0%, #0E7065 100%);
    transform: translateY(-1px);
}
.bp-action-enquire {
    background: #EFF6FF;
    color: #1D4ED8 !important;
    border: 1px solid #BFDBFE;
}
.bp-action-enquire:hover {
    background: #1D4ED8;
    color: #ffffff !important;
}
.bp-action-save {
    background: #FFF7ED;
    color: #D84315 !important;
    border: 1px solid #FDBA74;
}
.bp-action-save.is-saved,
.bp-action-save:hover {
    background: #D84315;
    color: #ffffff !important;
    border-color: #D84315;
}

.lt-btn {
    border: none;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 7px 8px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    text-decoration: none !important;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
    min-height: 36px;
    box-sizing: border-box;
    cursor: pointer;
    white-space: nowrap;
}

.lt-btn i {
    font-size: 0.92rem;
}

/* Primary Highlight: Call Now (Deep Gerua) */
.lt-btn.lt-call {
    background: linear-gradient(135deg, #E65100 0%, #D84315 100%);
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(216, 67, 21, 0.25);
}
.lt-btn.lt-call:hover {
    background: linear-gradient(135deg, #D84315 0%, #BF360C 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(216, 67, 21, 0.35);
}

/* Primary Highlight: WhatsApp Chat */
.lt-btn.lt-wa {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff !important;
    box-shadow: 0 3px 8px rgba(37, 211, 102, 0.25);
}
.lt-btn.lt-wa:hover {
    background: linear-gradient(135deg, #22BF5B 0%, #0E7065 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(37, 211, 102, 0.35);
}

/* Highlight: View Profile */
.lt-btn.lt-profile {
    background: #EFF6FF;
    color: #1D4ED8 !important;
    border: 1px solid #BFDBFE;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.lt-btn.lt-profile:hover {
    background: #1D4ED8;
    color: #ffffff !important;
    border-color: #1D4ED8;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(29, 78, 216, 0.25);
}

/* Highlight: Direction */
.lt-btn.lt-direction {
    background: #F8FAFC;
    color: #334155 !important;
    border: 1px solid #CBD5E1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.lt-btn.lt-direction:hover {
    background: #0284C7;
    color: #ffffff !important;
    border-color: #0284C7;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

/* Secondary Actions */
.lt-btn.lt-secondary {
    flex: 1;
    background: #f1f5f9;
    color: #334155 !important;
    border: 1px solid #e2e8f0;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.4rem 0.5rem;
    min-height: 34px;
}
.lt-btn.lt-secondary:hover {
    background: #e2e8f0;
    color: #0f172a !important;
}
.lt-btn.lt-secondary i {
    font-size: 0.85rem;
    color: #64748b;
}

/* Unified Tight Engagement Bar (Same unit as CTAs, seamless 6px gap) */
.feed-engagement-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 7px;
    margin-top: 7px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.82rem;
    color: #64748b;
}

/* Modern Header Search, Filter & Sort Section */
.header-search-filter-sort {
    flex: 1 1 auto;
    max-width: 580px;
    margin: 0 16px;
}
.header-sfs-container {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    transition: all 0.2s ease;
    overflow: hidden;
    padding: 2px 4px 2px 12px;
    width: 100%;
}
.header-sfs-container:focus-within, .header-sfs-container:hover {
    border-color: #1E5EE6;
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(30, 94, 230, 0.12);
}
.header-sfs-input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.88rem;
    color: #1e293b;
    flex: 1 1 140px;
    min-width: 110px;
    padding: 6px 4px;
}
.header-sfs-divider {
    width: 1px;
    height: 20px;
    background: #cbd5e1;
    margin: 0 4px;
    flex-shrink: 0;
}
.header-sfs-select {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.8rem;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
    max-width: 125px;
}
.header-sfs-btn {
    border: none;
    background: #1E5EE6;
    color: #ffffff;
    border-radius: 999px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
    margin-left: 2px;
}
.header-sfs-btn:hover {
    background: #1545b3;
}

/* Mobile Bottom Nav Spacing Fix (Prevent cards and bottom elements from getting obscured) */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 85px !important;
    }
    .mobile-bottom-nav {
        z-index: 1040;
    }
}

/* Responsive adjustments for desktop */
@media (min-width: 768px) {
    .feed-actions {
        flex-direction: row;
        align-items: center;
        gap: 0.6rem;
        padding: 0.85rem 1.25rem;
    }
    .feed-actions-primary {
        flex: 1.5;
        gap: 0.5rem;
    }
    .feed-actions-secondary {
        flex: 1;
        gap: 0.4rem;
    }
}
