/* =========================================
   1. GLOBAL VARIABLES & THEME
   ========================================= */
:root {
    --primary-color: #FF6B6B; /* Mewoofie Red */
    --primary-hover: #ff5252;
    --secondary-color: #f0f2f5; /* Light Gray Background */
    --text-dark: #1c1e21;
    --text-muted: #65676b;
    --border-radius: 16px;
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --header-height: 70px;
    --footer-height: 70px;
    --transition-speed: 0.3s;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Status Colors */
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --info: #0984e3;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--secondary-color);
    font-family: var(--font-stack);
    color: var(--text-dark);
    padding-top: var(--header-height);
    padding-bottom: 0; /* Default: Landing Page Mode */
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* Fix: Only add bottom padding on MOBILE when logged in */
body.mobile-app-view {
    padding-bottom: 90px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--primary-color);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

/* =========================================
   2. HEADER & NAVIGATION STYLES
   ========================================= */
.main-header {
    background: #fff;
    height: var(--header-height);
    z-index: 1040;
    position: fixed;
    top: 0;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    display: flex;
    align-items: center;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--primary-color) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -1px;
    white-space: nowrap;
}

.nav-icon {
    color: var(--text-dark);
    font-size: 1.3rem;
    padding: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-icon:hover, .nav-icon.active {
    background-color: rgba(255, 107, 107, 0.1);
    color: var(--primary-color);
}

.badge-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 10px;
    height: 10px;
    background-color: red;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* =========================================
   3. SEARCH BAR (CENTERED & PILL SHAPE)
   ========================================= */
.search-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.search-container {
    width: 100%;
    max-width: 450px;
}

.search-container .input-group {
    background: var(--secondary-color);
    border-radius: 50px;
    padding: 5px 20px;
    border: 1px solid transparent;
    transition: 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-container .input-group:focus-within {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

.search-container .input-group-text {
    background: transparent;
    border: none;
    padding-right: 10px;
    color: #999;
}

.search-container .form-control {
    background: transparent;
    border: none;
    box-shadow: none;
    padding-left: 0;
    font-size: 0.95rem;
    height: auto;
    color: #333;
}

/* =========================================
   4. LANDING PAGE (HERO & FEATURES)
   ========================================= */
.hero-section {
    background: #fff;
    padding: 100px 20px;
    text-align: center;
    border-radius: 0 0 50px 50px;
    margin-bottom: 60px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
}

.hero-title {
    font-size: 3.5rem;
    color: #111;
    line-height: 1.1;
    margin-bottom: 25px;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto 40px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature-card {
    background: #fff;
    padding: 40px;
    border-radius: 24px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
    text-align: left;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 25px;
    display: inline-block;
    background: rgba(255, 107, 107, 0.1);
    padding: 15px;
    border-radius: 16px;
}

.testimonials-section {
    padding: 80px 20px;
    background: #fff;
    margin-top: 60px;
}

.testimonial-card {
    background: var(--secondary-color);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    position: relative;
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* =========================================
   5. AUTH PAGES (LOGIN/REGISTER)
   ========================================= */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
    padding: 20px;
}

.auth-card {
    background: #fff;
    padding: 50px 40px;
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-logo {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 30px;
    display: block;
}

.auth-input {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 16px;
    border-radius: 14px;
    width: 100%;
    margin-bottom: 20px;
    transition: 0.2s;
    font-size: 1rem;
}

.auth-input:focus {
    background: #fff;
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

/* =========================================
   6. FEED & POST CARDS
   ========================================= */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    background: #fff;
    overflow: hidden;
    margin-bottom: 24px;
    transition: transform 0.2s;
}

.card-header {
    background: transparent;
    border-bottom: none;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-footer {
    background: transparent;
    border-top: none;
    padding: 10px 20px 25px;
}

.card-img-top {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    margin-top: 10px;
    max-height: 600px;
}

.avatar-small {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    margin-right: 15px;
}

/* =========================================
   7. PROFILE PAGE STYLING (FIXED GRADIENT)
   ========================================= */
.profile-cover {
    height: 200px;
    /* Red Gradient Background */
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%) !important;
    border-radius: 0 0 30px 30px;
    margin-bottom: 0; /* Remove gap */
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    opacity: 1 !important;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 6px solid #fff;
    
    /* Negative Margin Fix */
    display: block;
    margin: 0 auto;
    margin-top: -75px; 
    margin-bottom: 15px;
    
    position: relative;
    z-index: 10;
    background: #fff;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.stat-box {
    text-align: center;
    padding: 15px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
    min-width: 110px;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 107, 107, 0.15);
    border-color: var(--primary-color);
}

.stat-number {
    font-weight: 800;
    font-size: 1.4rem;
    display: block;
    color: #111;
}

.stat-label {
    font-size: 0.85rem;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =========================================
   8. CHAT INTERFACE
   ========================================= */
.chat-container {
    height: calc(100vh - 100px);
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #eee;
    box-shadow: var(--card-shadow);
    display: flex;
}

.chat-sidebar {
    background: #fff;
    border-right: 1px solid #f0f0f0;
    height: 100%;
    overflow-y: auto;
    width: 320px;
    flex-shrink: 0;
}

.chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.chat-user-item {
    padding: 20px;
    border-bottom: 1px solid #f9f9f9;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.chat-user-item:hover { background: #f8f9fa; }
.chat-user-item.active { background: #fff0f0; border-left: 4px solid var(--primary-color); }

.chat-messages-area {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fcfcfc;
}

.chat-bubble {
    padding: 14px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 70%;
    position: relative;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-me { background: var(--primary-color); color: white; margin-left: auto; border-bottom-right-radius: 4px; }
.chat-them { background: #fff; color: #111; margin-right: auto; border-bottom-left-radius: 4px; border: 1px solid #eee; }

/* =========================================
   9. SERVICES & SHOP STYLES (RESTORED)
   ========================================= */
.service-card {
    border: none;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s;
    background: white;
}

.service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.service-img {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.service-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
}

.price-tag {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* =========================================
   10. LOST & FOUND ALERT STYLES (RESTORED)
   ========================================= */
.alert-card {
    border: 2px solid var(--danger);
    background: #fff5f5;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.alert-badge {
    background: var(--danger);
    color: white;
    padding: 5px 15px;
    font-weight: bold;
    text-transform: uppercase;
    position: absolute;
    top: 15px;
    right: 15px;
    border-radius: 50px;
}

.alert-info {
    padding: 20px;
}

/* =========================================
   11. VOICE FOR PAW (DONATIONS) (RESTORED)
   ========================================= */
.campaign-card {
    border-radius: 20px;
    background: white;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.progress-bar-custom {
    height: 10px;
    background: #eee;
    border-radius: 50px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 1s ease-in-out;
}

/* =========================================
   12. ADMIN DASHBOARD (RESTORED)
   ========================================= */
.admin-sidebar {
    background: #2d3436;
    color: white;
    min-height: 100vh;
    padding: 20px;
}

.admin-link {
    color: rgba(255,255,255,0.7);
    padding: 12px;
    display: block;
    border-radius: 10px;
    margin-bottom: 5px;
    transition: 0.2s;
}

.admin-link:hover, .admin-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.admin-table tr {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    border-radius: 10px;
}

.admin-table td, .admin-table th {
    padding: 15px;
    vertical-align: middle;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-active { background: #e6fffa; color: #00b894; }
.status-blocked { background: #fff5f5; color: #d63031; }
.status-pending { background: #fffbf0; color: #fdcb6e; }

/* =========================================
   13. BUTTONS & UTILITIES
   ========================================= */
.btn-primary {
    background-color: var(--primary-color);
    border: none;
    border-radius: 50px;
    padding: 12px 30px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 50px;
    font-weight: 700;
    padding: 10px 24px;
    transition: 0.2s;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-action {
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.btn-action:hover { background: #fff0f0; color: var(--primary-color); }

/* =========================================
   14. MOBILE NAVIGATION (BULLETPROOF GRID)
   ========================================= */
@media (min-width: 769px) { .mobile-bottom-nav { display: none !important; } }

@media (max-width: 768px) {
    .container { padding-left: 15px; padding-right: 15px; }
    
    /* Footer Container */
    .mobile-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 70px;
        background: #fff;
        border-top: 1px solid #eee;
        display: grid !important;
        grid-template-columns: repeat(5, 1fr);
        align-items: center;
        justify-items: center;
        z-index: 9999 !important;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
	        pointer-events: auto;
    }

	    .mobile-bottom-nav a,
	    .mobile-bottom-nav button {
	        pointer-events: auto;
	    }

    /* Individual Icons */
    .nav-item {
        color: var(--text-dark);
        font-size: 1.5rem;
        display: flex; justify-content: center; align-items: center;
	        width: 100%; height: 100%; opacity: 0.6; transition: 0.2s;
	        pointer-events: auto;
    }
    .nav-item:active, .nav-item.active { opacity: 1; color: var(--primary-color); }

    /* Floating Button */
    .plus-btn-wrapper { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
    .plus-btn-mobile {
        width: 60px; height: 60px;
        background: var(--primary-color);
        color: white;
        border-radius: 50%;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.8rem;
        position: absolute; top: -30px; 
        border: 5px solid #fff;
        box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
        transition: transform 0.1s;
    }
    .plus-btn-mobile:active { transform: scale(0.95); }
}

/* =========================================
   15. UTILITIES, MODALS, CROPPER
   ========================================= */
#mention-list {
    position: absolute; background: white; border: 1px solid #eee;
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none; z-index: 9999; width: 250px; max-height: 250px; overflow-y: auto;
}
.mention-item { padding: 12px 15px; cursor: pointer; display: flex; align-items: center; border-bottom: 1px solid #f9f9f9; }
.mention-item img { width: 35px; height: 35px; border-radius: 50%; margin-right: 12px; }

.modal-content { border-radius: 24px; border: none; box-shadow: 0 20px 60px rgba(0,0,0,0.2); overflow: hidden; }
.modal-header { border-bottom: 1px solid #f0f0f0; padding: 25px; background: #fff; }
.modal-body { padding: 30px; background: #fff; }

.img-container { max-height: 500px; width: 100%; background: #000; }
.img-container img { max-width: 100%; display: block; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes float { 0% { transform: translateY(0px); } 50% { transform: translateY(-5px); } 100% { transform: translateY(0px); } }

.card, .chat-bubble, .feature-card { animation: fadeIn 0.4s ease-out forwards; }
.modal-content { animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.plus-btn-mobile { animation: float 3s ease-in-out infinite; }