/* =============================================
   Vitrixon — Modern Marketplace Styles
   itemsatış benzeri koyu tema, kartlar ve bileşenler
   ============================================= */

/* Prevent flash of unstyled content during theme load */
html { transition: background-color 0.15s ease, color 0.15s ease; }

/* ---- Tailwind primary color via CSS variable ---- */
.text-primary   { color: var(--primary) !important; }
.bg-primary     { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.ring-primary   { --tw-ring-color: var(--primary) !important; }
.focus\:border-primary:focus { border-color: var(--primary) !important; }
.focus\:ring-primary:focus   { --tw-ring-color: var(--primary) !important; }
.hover\:text-primary:hover   { color: var(--primary) !important; }
.from-primary   { --tw-gradient-from: var(--primary) !important; }
.bg-primary\/10 { background-color: color-mix(in srgb, var(--primary) 10%, transparent) !important; }
.bg-primary\/20 { background-color: color-mix(in srgb, var(--primary) 20%, transparent) !important; }
.border-primary\/30 { border-color: color-mix(in srgb, var(--primary) 30%, transparent) !important; }

/* ---- Dark mode: Input backgrounds ---- */
.dark input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.dark textarea,
.dark select {
    background-color: rgb(17 24 39) !important;
    color: rgb(243 244 246) !important;
}
.dark input::placeholder,
.dark textarea::placeholder { color: rgb(107 114 128); }

/* ---- Dark mode: card / panel backgrounds ---- */
.dark .bg-white { background-color: rgb(17 24 39) !important; }

/* =============================================
   MARKETPLACE CARD — itemsatış benzeri
   ============================================= */
.card-marketplace {
    position: relative;
    border-radius: 12px !important;
    overflow: hidden;
    background: #fff;
    border: 2px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .card-marketplace {
    background: #1a1f2e;
    border-color: #374151;
}
.card-marketplace:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.15), 
                0 8px 20px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.5);
}
.dark .card-marketplace:hover {
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.25), 
                0 8px 20px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(124, 58, 237, 0.3);
    border-color: rgba(124, 58, 237, 0.6);
}

/* Hover: gradient overlay on image */
.card-marketplace::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(180deg, transparent 0%, rgba(124, 58, 237, 0.15) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}
.card-marketplace:hover::before {
    opacity: 1;
}

/* ---- Line clamp utility ---- */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =============================================
   LISTING CARD (Legacy compatibility)
   ============================================= */
.listing-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.dark .listing-card {
    background: #1a1f2e;
    border-color: #252b3b;
}
.listing-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.15), 
                0 8px 20px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(124, 58, 237, 0.1);
    border-color: rgba(124, 58, 237, 0.5);
}
.dark .listing-card:hover {
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.25), 
                0 8px 20px rgba(0, 0, 0, 0.4);
}
.listing-card .card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #f3f4f6;
}
.dark .listing-card .card-img {
    background: #0f172a;
    border-bottom-color: #1e293b;
}
.listing-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.listing-card:hover .card-img img { transform: scale(1.1) rotate(1deg); }
.listing-card .card-body { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.listing-card .card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    min-height: 36px;
}
.dark .listing-card .card-title { color: #f1f5f9; }
.listing-card:hover .card-title { color: var(--primary); }
.listing-card .card-price {
    font-size: 1rem;
    font-weight: 900;
    color: var(--primary);
    margin-bottom: 6px;
}
.listing-card .card-meta {
    font-size: 0.7rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px solid #f3f4f6;
}
.dark .listing-card .card-meta { border-top-color: #1e293b; }

/* ---- Featured badge ---- */
.badge-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245,158,11,0.5);
}

/* =============================================
   CATEGORY PILLS — itemsatış benzeri
   ============================================= */
.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.dark .cat-pill {
    background: #1a1f2e;
    border-color: #252b3b;
    color: #cbd5e1;
}
.cat-pill:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent);
}
.dark .cat-pill:hover { color: #fff; }
.cat-pill .cat-count {
    font-size: 0.7rem;
    opacity: 0.7;
    font-weight: 500;
}
.cat-pill:hover .cat-count { opacity: 0.9; color: rgba(255,255,255,0.85); }

/* =============================================
   SECTION HEADER
   ============================================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.section-title {
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dark .section-title { color: #f1f5f9; }
.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}
.section-viewall {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 3px;
}
.section-viewall:hover { opacity: 0.8; }

/* =============================================
   CATEGORY PAGE GRID
   ============================================= */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px)  { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px)  { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }

/* =============================================
   LISTING GRID (from home.php inline)
   ============================================= */
.l-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media(min-width:480px)  { .l-grid { grid-template-columns: repeat(4, 1fr); } }
@media(min-width:768px)  { .l-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; } }
@media(min-width:1024px) { .l-grid { grid-template-columns: repeat(6, 1fr); } }
@media(min-width:1280px) { .l-grid { grid-template-columns: repeat(7, 1fr); } }
@media(min-width:1536px) { .l-grid { grid-template-columns: repeat(8, 1fr); } }

/* ---- Listing card (inline from home) ---- */
.lc {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    border: 1.5px solid #f1f5f9;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .lc { background: #1a1f2e; border-color: #252b3b; }
.lc:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(124,58,237,0.08), 0 4px 12px rgba(0,0,0,0.06); border-color: rgba(124,58,237,0.3); }
.dark .lc:hover { box-shadow: 0 12px 40px rgba(124,58,237,0.15), 0 4px 12px rgba(0,0,0,0.3); }

.lc-img {
    width: 100%;
    aspect-ratio: 1/1;
    background: #f8fafc;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f1f5f9;
}
.dark .lc-img { background: #0f172a; border-bottom-color: #1e293b; }
.lc-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.lc:hover .lc-img img { transform: scale(1.1) rotate(1deg); }

.lc-body { padding: 7px 9px 9px; flex: 1; display: flex; flex-direction: column; }
.lc-title {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    min-height: 28px;
}
.dark .lc-title { color: #e2e8f0; }
.lc:hover .lc-title { color: var(--primary); }
.lc-price { font-size: 13px; font-weight: 900; color: var(--primary); margin-bottom: 4px; }
.lc-no-price { font-size: 10px; color: #94a3b8; margin-bottom: 4px; }
.lc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9px;
    color: #94a3b8;
    margin-top: auto;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}
.dark .lc-meta { border-top-color: #1e293b; }

/* ---- Featured badge (inline) ---- */
.fc-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 5;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 16px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    box-shadow: 0 2px 6px rgba(245,158,11,0.4);
    letter-spacing: 0.04em;
}

/* =============================================
   QUILL EDITOR DARK MODE
   ============================================= */
.dark .ql-toolbar { background: rgb(31 41 55); border-color: rgb(55 65 81) !important; }
.dark .ql-container { background: rgb(17 24 39); border-color: rgb(55 65 81) !important; color: rgb(229 231 235); }
.dark .ql-editor.ql-blank::before { color: rgb(107 114 128); }
.dark .ql-stroke { stroke: rgb(156 163 175) !important; }
.dark .ql-fill   { fill: rgb(156 163 175) !important; }
.dark .ql-picker-label { color: rgb(156 163 175) !important; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgb(209 213 219); border-radius: 4px; }
.dark ::-webkit-scrollbar-thumb { background: rgb(75 85 99); }

/* =============================================
   FILE INPUT BUTTON
   ============================================= */
input[type="file"]::file-selector-button {
    background: var(--primary);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    border: none;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.75rem;
    transition: opacity 0.15s;
}
input[type="file"]::file-selector-button:hover { opacity: 0.85; }

/* =============================================
   TOAST FLASH ANIMATION
   ============================================= */
#flash-alert, #flash-alert-error, #flash-alert-warn {
    animation: slideDown 0.3s ease forwards;
}
@keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -16px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

/* =============================================
   MOBILE BOTTOM NAV SAFE AREA
   ============================================= */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .safe-area-inset-bottom { padding-bottom: env(safe-area-inset-bottom); }
}

/* =============================================
   LISTING GRID (alternate)
   ============================================= */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media (min-width: 640px)  { .listings-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; } }
@media (min-width: 768px)  { .listings-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1024px) { .listings-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1280px) { .listings-grid { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 1536px) { .listings-grid { grid-template-columns: repeat(8, 1fr); } }

/* Categories scroll */
.cats-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
@media (max-width: 640px) {
    .cats-scroll {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    .cats-scroll::-webkit-scrollbar { display: none; }
}

/* =============================================
   ANIMATE GRADIENT TEXT
   ============================================= */
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* =============================================
   CATEGORY SIDEBAR — itemsatış benzeri
   ============================================= */
.sidebar-categories {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    overflow: hidden;
}
.dark .sidebar-categories {
    background: #1a1f2e;
    border-color: #252b3b;
}
.sidebar-categories .sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}
.dark .sidebar-categories .sidebar-item { color: #9ca3af; }
.sidebar-categories .sidebar-item:hover {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    color: var(--primary);
    border-left-color: var(--primary);
}
.sidebar-categories .sidebar-item.active {
    background: color-mix(in srgb, var(--primary) 8%, transparent);
    color: var(--primary);
    font-weight: 700;
    border-left-color: var(--primary);
}
.sidebar-categories .sidebar-item .count {
    font-size: 11px;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.dark .sidebar-categories .sidebar-item .count {
    background: #252b3b;
    color: #6b7280;
}

/* =============================================
   FILTER CARD — itemsatış benzeri
   ============================================= */
.filter-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 20px;
}
.dark .filter-card {
    background: #1a1f2e;
    border-color: #252b3b;
}
.filter-card h3 {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}
.dark .filter-card h3 {
    color: #f1f5f9;
    border-bottom-color: #252b3b;
}
.filter-card label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 6px;
}
.filter-card input,
.filter-card select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
    background: #fff;
}
.dark .filter-card input,
.dark .filter-card select {
    background: #0f172a;
    border-color: #252b3b;
    color: #e2e8f0;
}
.filter-card input:focus,
.filter-card select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}
.filter-card .filter-btn {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 8px;
}
.filter-card .filter-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* =============================================
   CATEGORY HEADER BANNER
   ============================================= */
.cat-banner {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 60%, #1e1b4b) 100%);
}
.cat-banner .cat-banner-content {
    padding: 28px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}
.cat-banner .cat-banner-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.cat-banner h1 {
    font-size: 22px;
    font-weight: 900;
    color: #fff;
    margin: 0;
}
.cat-banner p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin: 4px 0 0;
}
.cat-banner .cat-banner-btn {
    margin-left: auto;
    padding: 10px 20px;
    border-radius: 12px;
    background: #fff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.cat-banner .cat-banner-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    border: 2px dashed #e5e7eb;
    border-radius: 16px;
    background: #fafafa;
}
.dark .empty-state {
    border-color: #252b3b;
    background: #1a1f2e;
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}
.empty-state h3 {
    font-size: 16px;
    font-weight: 700;
    color: #374151;
    margin: 0 0 4px;
}
.dark .empty-state h3 { color: #e2e8f0; }
.empty-state p {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 16px;
}

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 16px;
}
.breadcrumb a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .separator {
    color: #d1d5db;
}
.breadcrumb .current {
    color: #374151;
    font-weight: 600;
}
.dark .breadcrumb .current { color: #e2e8f0; }

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}
.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.pagination a {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #4b5563;
}
.dark .pagination a {
    background: #1a1f2e;
    border-color: #252b3b;
    color: #9ca3af;
}
.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 5%, transparent);
}
.pagination .active {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
}

/* =============================================
   USER STORE CARD
   ============================================= */
.store-card {
    background: #fff;
    border: 1px solid #f1f5f9;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dark .store-card {
    background: #1a1f2e;
    border-color: #252b3b;
}
.store-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-color: rgba(124, 58, 237, 0.2);
}
.store-card .store-cover {
    height: 120px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    position: relative;
}
.store-card .store-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    border: 3px solid #fff;
    background: #f3f4f6;
    position: absolute;
    bottom: -32px;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
}
.dark .store-card .store-avatar { border-color: #1a1f2e; }

/* =============================================
   AD CONTAINER - CENTER ALL ADS
   ============================================= */
.ad-container {
    text-align: center !important;
    display: block !important;
}

.ad-container img,
.ad-container iframe,
.ad-container video,
.ad-container > * {
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
