/*
Theme Name: Hibu
Description: A service marketplace theme like Armut.
Author: Antigravity
Version: 1.3
*/

:root {
    /* Brand Colors (Herisburda New) */
    --primary-color: #ff5e00;
    /* Vibrant Orange */
    --primary-hover: #ff6d00;
    --border-radius: 12px;

    /* Theme Variables (Light Default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #4b5563;
    --border-color: #e5e7eb;
    --card-bg: #ffffff;
    --card-text: #374151;
    --toggle-bg: rgba(0, 0, 0, 0.05);
    --toggle-border: rgba(0, 0, 0, 0.1);
    --toggle-icon: #374151;
    --tag-item-bg: #f3f4f6;
    --tag-item-text: #4b5563;

    --text-muted: var(--text-secondary);
}

[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --card-bg: #1f2937;
    --card-text: #d1d5db;
    --toggle-bg: rgba(255, 255, 255, 0.1);
    --toggle-border: rgba(255, 255, 255, 0.2);
    --toggle-icon: #f9fafb;
    --tag-item-bg: #374151;
    --tag-item-text: #9ca3af;
}

body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background 0.3s, color 0.3s;
}

.hibu-card,
article {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

.hibu-card-title,
.hibu-card-title a,
h1,
h2,
h3,
h4,
h5 {
    color: var(--text-primary) !important;
}

.hibu-card-text,
.hibu-card-date,
.post-date {
    color: var(--text-secondary) !important;
}


.tag-item:hover,
.tag-item.active {
    background: var(--primary-color) !important;
    color: white !important;
}

#theme-toggle {
    background: var(--toggle-bg) !important;
    border-color: var(--toggle-border) !important;
}

#theme-icon {
    color: var(--toggle-icon) !important;
}

/* Custom Logo Styling */
.custom-logo-link {
    display: inline-block;
}

.custom-logo {
    height: 48px;
    width: auto;
    display: block;
    margin: 0;
}

/* Header UI Enhancements */
.header-top {
    padding: 10px 10px !important;
    gap: 12px;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 17px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.header-action-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

.header-action-btn .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ea4e27;
    color: #fff;
    font-size: 8px;
    font-weight: 800;
    min-width: 15px;
    height: 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

/* Home Action Row (Midi Buttons) */
.home-action-row {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.home-action-row::-webkit-scrollbar {
    display: none;
}

.action-btn-midi {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 50px;
    color: white !important;
    text-decoration: none !important;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.2;
}

.action-btn-midi:active {
    transform: scale(0.95);
}

.action-btn-midi i,
.action-btn-midi img {
    font-size: 14px;
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.action-btn-midi.red {
    background: #ea4e27;
}

.action-btn-midi.blue {
    background: #075985;
}

.action-btn-midi.green {
    background: #16a34a;
}

@media (max-width: 767px) {
    .header-top {
        padding: 8px 10px !important;
        gap: 6px;
    }

    .custom-logo {
        height: 32px;
    }

    .header-right {
        gap: 5px;
    }


    .header-action-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .header-action-btn .badge {
        width: 14px;
        height: 14px;
        font-size: 8px;
    }

    #theme-toggle {
        width: 34px !important;
        height: 34px !important;
    }
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding-bottom: 70px;
    /* Space for bottom nav */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .container {
        padding: 0 15px !important;
    }
}

/* Rounded Search Bar */
.search-container {
    position: relative;
    background: var(--bg-secondary);
    /* White background as requested */
    border-radius: 50px;
    /* Fully rounded */
    padding: 3px;
    /* Reduced padding */
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-container input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    /* Dark text on white */
    padding: 8px 15px;
    /* Reduced vertical padding */
    flex-grow: 1;
    font-size: 14px;
    /* Slightly smaller font */
    outline: none;
    width: auto;
}

.search-container button {
    position: static;
    /* Reset absolute */
    transform: none;
    background: var(--primary-color);
    color: white;
    border: none;
    min-width: 32px;
    height: 32px;
    /* Smaller button */
    border-radius: 50%;
    /* Circle button */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
}

/* Pills / Tags */
.tags-scroll-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 5px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.tags-scroll-container::-webkit-scrollbar {
    display: none;
}

.tag-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tag-item:nth-child(8n+1) {
    background: #2563eb !important;
    color: #fff !important;
    border-color: #1d4ed8 !important;
}

.tag-item:nth-child(8n+2) {
    background: #f97316 !important;
    color: #fff !important;
    border-color: #ea580c !important;
}

.tag-item:nth-child(8n+3) {
    background: #16a34a !important;
    color: #fff !important;
    border-color: #15803d !important;
}

.tag-item:nth-child(8n+4) {
    background: #9333ea !important;
    color: #fff !important;
    border-color: #7e22ce !important;
}

.tag-item:nth-child(8n+5) {
    background: #dc2626 !important;
    color: #fff !important;
    border-color: #b91c1c !important;
}

.tag-item:nth-child(8n+6) {
    background: #0d9488 !important;
    color: #fff !important;
    border-color: #0f766e !important;
}

.tag-item:nth-child(8n+7) {
    background: #db2777 !important;
    color: #fff !important;
    border-color: #be185d !important;
}

.tag-item:nth-child(8n+8) {
    background: #4f46e5 !important;
    color: #fff !important;
    border-color: #4338ca !important;
}

.tag-item:active {
    transform: scale(0.95);
}

.tag-item.active,
.tag-item:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

/* Card Styling */
.category-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
    aspect-ratio: 1 / 1;
}

.category-item:hover img {
    transform: scale(1.05);
    opacity: 0.6;
}

.category-item img {
    border-radius: 8px;
}

/* Dense Grid Layout for Desktop (Categories & Vitrin) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding: 11px;
}

@media (max-width: 767px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
}

/* Mobile Specifics (<768px) */
/* Mobile Specifics (<768px) */
@media (max-width: 767px) {

    /* Vitrin (Showcase) specific: Stacked vertically */
    #home-post-grid.category-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    /* Force items to take full width */
    #home-post-grid .category-item {
        width: 100% !important;
        max-width: 100% !important;
        aspect-ratio: auto;
        height: auto;
        min-height: 200px;
    }


}

@media (min-width: 768px) {
    .category-grid {
        /* Tablet: slightly more cols */
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

/* PC/Desktop Layout (>992px) */
@media (min-width: 992px) {

    /* TOP CATEGORIES (Speed Dial Style) */
    .category-grid:not(#home-post-grid) {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        justify-content: center;
        gap: 20px;
    }

    /* Fixed Size Cards */
    .category-grid:not(#home-post-grid) .category-item {
        width: 100% !important;
        height: 180px !important;
        margin: 0 !important;
        border-radius: 20px;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
        aspect-ratio: 1/1;
        position: relative;
        background: #2a2a2a;
    }

    /* Scaled Overlay */
    .category-grid:not(#home-post-grid) .category-overlay {
        padding: 12px;
        height: 50px;
        background: rgba(0, 0, 0, 0.6);
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .category-grid:not(#home-post-grid) .category-item h5 {
        font-size: 16px;
        font-weight: 700;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
        line-height: 1.2;
    }

    /* BOTTOM VITRIN */
    #home-post-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }

    /* Container Padding Fix */
    /* Ensure content isn't stuck to edges */
    .container {
        padding: 0 60px !important;
        /* Increased from 50px */
        max-width: 1240px;
        /* Slightly wider to accommodate padding */
    }
}

/* ARCHIVE & CATEGORY PAGE OVERRIDES (List View) */
/* Force single column vertically stacked list on ALL devices */
/* High specificity to override homepage 100px grid rules */
body.archive .category-grid:not(#unused-id),
body.category .category-grid:not(#unused-id) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 15px;
}

body.archive .category-item,
body.category .category-item {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
    max-width: 100% !important;
    flex-direction: row !important;
    /* Force row layout */
}

/* PREMIUM CARD REDESIGN (Archive/Category Pages) */
.hibu-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.hibu-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 145, 0, 0.3);
}

.hibu-card-header {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.hibu-card-user {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.hibu-card-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
}

.hibu-card-username {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    color: var(--primary-color);
}

.hibu-card-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

.hibu-card-body {
    padding: 0;
    display: flex;
    flex-direction: row;
    /* Default for list/PC */
    min-height: 140px;
}

@media (max-width: 767px) {
    .hibu-card-body {
        flex-direction: column;
    }

    .hibu-card-thumbnail {
        width: 100% !important;
        height: 200px !important;
    }
}

.hibu-card-thumbnail {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    overflow: hidden;
}

.hibu-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hibu-card:hover .hibu-card-thumbnail img {
    transform: scale(1.1);
}

.hibu-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hibu-card-title {
    margin: 0 0 8px;
    font-size: 15px;
    line-height: 1.2;
}

.hibu-card-title a {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.2s;
}

.hibu-card-title a:hover {
    color: var(--primary-color);
}

.hibu-card-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.hibu-card-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 16px;
    margin-right: 8px;
}

.hibu-card-location {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #ffd180;
    /* Soft amber */
    background: rgba(255, 145, 0, 0.1);
    padding: 6px 12px;
    border-radius: 50px;
    width: fit-content;
    border: 1px solid rgba(255, 145, 0, 0.2);
}

.hibu-card-location i {
    font-size: 14px;
}

.hibu-card-delete {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 34px;
    height: 34px;
    background: rgba(255, 68, 68, 0.1);
    color: #ff4444;
    border: 1px solid rgba(255, 68, 68, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.hibu-card-delete:hover {
    background: #ff4444;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.4);
}

.hibu-card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hibu-card-badge i {
    font-size: 12px;
}

.category-item-tag {
    position: absolute !important;
    bottom: 2px !important;
    top: auto !important;
    right: 9px;
    color: #fff;
    font-size: 7px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}



.category-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: transform 0.3s, opacity 0.3s;
}

.category-item:hover img {
    transform: scale(1.05);
    opacity: 0.6;
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    box-sizing: border-box;
}

.category-item h5 {
    font-size: 13px;
    margin: 0;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Bottom Navbar */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(30, 30, 30, 0.95);
    /* Semi-transparent dark */
    backdrop-filter: blur(10px);
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 8px 0;
    z-index: 5000;
}

.nav-item {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    transition: all 0.3s;
}

.nav-item.active,
.nav-item:hover {
    color: #fff;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 5px;
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    font-weight: 600;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 400px;
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    background: #2c2c2c;
    color: #fff;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* File Upload Styles */
.image-upload-wrapper {
    margin-top: 5px;
}

.image-upload-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #333;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px dashed #555;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    color: #fff;
}

.image-upload-label:hover {
    background: #444;
    border-color: var(--primary-color);
}

.image-upload-label i {
    font-size: 20px;
    margin-right: 10px;
    color: var(--primary-color);
}