/**
 * UI Improvements - Consolidated enhancements
 */

/* ═══════════════════════════════════════════
   GLOBAL DARK THEME: Forms, Tables, Filters
   Kill ALL remaining white backgrounds
   ═══════════════════════════════════════════ */

/* Form controls */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
    background: rgba(255, 255, 255, 0.04) !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e5e7eb !important;
    border-radius: 8px !important;
}

.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    background: rgba(255, 255, 255, 0.06) !important;
    background-color: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
    color: #ffffff !important;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

.form-select option {
    background: #111827 !important;
    color: #e5e7eb !important;
}

/* Tables */
.table,
table {
    color: #e5e7eb !important;
    --bs-table-bg: transparent !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04) !important;
}

.table th,
table th {
    background: rgba(255, 255, 255, 0.04) !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    color: #93c5fd !important;
}

.table td,
table td {
    background: transparent !important;
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
    color: #d1d5db !important;
}

.table tbody tr:hover td,
table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03) !important;
    background-color: rgba(255, 255, 255, 0.03) !important;
}

.table tfoot td,
table tfoot td {
    background: rgba(255, 255, 255, 0.02) !important;
    background-color: rgba(255, 255, 255, 0.02) !important;
}

/* Shop widget buttons (Search, Clear Filter) */
.shop-widget-btn {
    background: rgba(59, 130, 246, 0.15) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
    border-radius: 8px !important;
}

.shop-widget-btn:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
}

/* Filter bar */
.top-filter {
    background: transparent !important;
}

.filter-label {
    color: #9ca3af !important;
}

.filter-select {
    background: rgba(255, 255, 255, 0.04) !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e5e7eb !important;
}

/* Table scroll container */
.table-scroll {
    background: transparent !important;
}

/* Badge overrides */
.badge.bg-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #d1d5db !important;
}

.badge.bg-success {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #4ade80 !important;
}

.badge.bg-danger {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

.badge.bg-warning {
    background: rgba(251, 191, 36, 0.2) !important;
    color: #fbbf24 !important;
}

.badge.bg-info {
    background: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
}

/* Flatpickr dark */
.flatpickr-calendar {
    background: #111827 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

.flatpickr-day {
    color: #e5e7eb !important;
}

.flatpickr-day:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: transparent !important;
}

.flatpickr-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent !important;
    color: #e5e7eb !important;
}

.flatpickr-weekday {
    color: #6b7280 !important;
}

span.flatpickr-weekday {
    background: transparent !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: #e5e7eb !important;
    fill: #e5e7eb !important;
}

/* Nice Select dark override */
.nice-select {
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e5e7eb !important;
}

.nice-select .list {
    background: #111827 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.nice-select .option {
    background: transparent !important;
    color: #e5e7eb !important;
}

.nice-select .option:hover,
.nice-select .option.selected {
    background: rgba(59, 130, 246, 0.15) !important;
    color: #ffffff !important;
}

/* ═══════════════════════════════════════════
   NOTICE / ANNOUNCEMENT - Wide & compact layout
   ═══════════════════════════════════════════ */
.notice-wrap {
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
    padding: 16px 20px 14px !important;
    border-radius: 14px !important;
}

.notice-title {
    font-size: 13px !important;
    margin-bottom: 8px !important;
    letter-spacing: 1.2px !important;
}

/* Items: 2 columns on desktop, 1 on mobile */
.notice-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 5px 12px !important;
}

.notice-item {
    padding: 5px 8px !important;
    font-size: 11.8px !important;
    border-radius: 8px !important;
    gap: 6px !important;
}

.notice-item i {
    width: 13px !important;
    font-size: 11px !important;
    flex: 0 0 13px !important;
}

/* Section contact: inline */
.notice-wrap .section {
    margin-top: 8px !important;
    padding-top: 8px !important;
}

.notice-wrap .section-title {
    font-size: 11px !important;
    margin-bottom: 6px !important;
}

.notice-wrap .contact-row {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 5px !important;
}

.notice-wrap .contact-btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
}

.notice-wrap .bot-box {
    margin-top: 6px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
}

.notice-wrap .footer-note {
    margin-top: 6px !important;
    font-size: 10px !important;
}

.notice-wrap .lang-btn {
    padding: 4px 8px !important;
    font-size: 10px !important;
    border-radius: 8px !important;
}

/* 3 columns on wide screens */
@media (min-width: 1200px) {
    .notice-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* 1 column on mobile */
@media (max-width: 576px) {
    .notice-list {
        grid-template-columns: 1fr !important;
    }
    .notice-wrap .contact-row {
        grid-template-columns: 1fr !important;
    }
}

/* ═══════════════════════════════════════════
   #1: PRODUCT GRID - Fixed 2 columns on desktop
   ═══════════════════════════════════════════ */
.louk-grid {
    grid-template-columns: repeat(2, 1fr) !important;
}

@media (max-width: 768px) {
    .louk-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Price tag: 2-line compact (price on top, USD below) */
.louk-price-tag {
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 1px !important;
    padding: 5px 10px !important;
    text-align: right !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.louk-price-main {
    font-size: 15px !important;
    color: #4ade80 !important;
}

.louk-price-rate {
    margin-top: 0 !important;
    font-size: 11px !important;
}

.louk-price-usd,
.louk-price-rate .louk-price-usd {
    color: #fda4af !important;
}

.louk-price-per {
    color: #00bfff !important;
}

/* ═══════════════════════════════════════════
   #2: CATEGORY TAB BAR
   ═══════════════════════════════════════════ */
.cat-tabbar {
    background: rgba(10, 14, 28, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 6px;
    margin: 12px 0 16px;
    position: relative;
}

.cat-tabbar-scroll {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cat-tabbar-scroll::-webkit-scrollbar {
    display: none;
}

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    background: transparent;
    border: none;
    border-radius: 8px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.cat-tab:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.06);
}

.cat-tab.active {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}

.cat-tab.active:hover {
    background: var(--primary-hover);
}

.cat-tab img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.cat-tab:hover img,
.cat-tab.active img {
    opacity: 1;
}

.cat-tab i {
    font-size: 13px;
}

.cat-tab.active i {
    color: #ffffff;
}

@media (max-width: 576px) {
    .cat-tabbar {
        border-radius: 10px;
        padding: 4px;
        margin: 8px 0 12px;
    }
    .cat-tab {
        padding: 6px 14px;
        font-size: 12px;
        gap: 5px;
    }
    .cat-tab img {
        width: 18px;
        height: 18px;
    }
}

/* ═══════════════════════════════════════════
   #4: PAGINATION - Dark theme fix
   ═══════════════════════════════════════════ */
.page-link {
    color: #d1d5db !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease;
}

.page-link:hover {
    color: #ffffff !important;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.page-item .active {
    color: #ffffff !important;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.page-info {
    color: #9ca3af !important;
}

.bottom-paginate {
    border-top-color: rgba(255, 255, 255, 0.08) !important;
}

/* ═══════════════════════════════════════════
   #5: SKELETON LOADING for product cards
   ═══════════════════════════════════════════ */
@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-card {
    background: rgba(10, 16, 30, 0.44);
    border: 1px solid rgba(120, 151, 210, 0.15);
    border-radius: 14px;
    padding: 10px;
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 156px;
    gap: 10px;
    align-items: center;
}

.skeleton-el {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.04) 25%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0.04) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: 8px;
}

.skeleton-avatar {
    width: 70px;
    height: 70px;
    border-radius: 10px;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 6px;
    width: 80%;
}

.skeleton-text-sm {
    height: 10px;
    width: 50%;
}

.skeleton-btn {
    height: 36px;
    border-radius: 9px;
}

.skeleton-price {
    height: 42px;
    border-radius: 9px;
    margin-bottom: 7px;
}

@media (max-width: 576px) {
    .skeleton-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }
    .skeleton-card .skeleton-side {
        grid-column: 1 / -1;
        display: flex;
        gap: 8px;
    }
    .skeleton-price, .skeleton-btn { flex: 1; }
}

/* ═══════════════════════════════════════════
   #6: EMPTY STATE - Better design
   ═══════════════════════════════════════════ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state svg {
    opacity: 0.3;
    margin-bottom: 20px;
    max-width: 120px;
    height: auto;
}

.empty-state p {
    color: #9ca3af !important;
    font-size: 15px;
    margin-bottom: 16px;
}

.empty-state-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.empty-state-cta:hover {
    background: var(--primary-hover);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    color: #ffffff;
}

/* ═══════════════════════════════════════════
   #7: UNIFIED BUTTON STYLES
   ═══════════════════════════════════════════ */
.btn-more,
.btn-more-new {
    max-width: 320px;
    padding: 10px 28px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #d1d5db !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease !important;
    cursor: pointer;
    text-decoration: none;
}

.btn-more:hover,
.btn-more-new:hover {
    color: #ffffff !important;
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2) !important;
}

/* ═══════════════════════════════════════════
   #9: MODAL ANIMATION - Smooth entrance
   ═══════════════════════════════════════════ */
.modal.fade .modal-dialog {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease !important;
    transform: scale(0.92) translateY(20px) !important;
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0) !important;
    opacity: 1;
}

.modal-backdrop.fade {
    transition: opacity 0.25s ease !important;
}

/* Better close button */
.modal-header .btn-close {
    filter: none !important;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0.7;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important;
    background-size: 10px !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.modal-header .btn-close:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: rgba(239, 68, 68, 0.4);
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════════
   #10: SCROLLBAR - Unified dark style
   ═══════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

/* ═══════════════════════════════════════════
   #11: CARD FOOTER BORDER - Better visibility
   ═══════════════════════════════════════════ */
.louk-card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* ═══════════════════════════════════════════
   #3: RECENT ORDERS MARQUEE - Top bar ticker
   ═══════════════════════════════════════════ */
.rop-marquee-section {
    position: relative;
    z-index: 3;
    padding: 10px 0 0;
    flex: 0 0 auto !important;
}

.rop-marquee-wrap {
    width: 100%;
    overflow: hidden;
    background: rgba(10, 14, 28, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 140, 200, 0.12);
    border-radius: 10px;
    padding: 0;
    position: relative;
    height: 38px;
    display: flex;
    align-items: center;
}

/* Fade edges */
.rop-marquee-wrap::before,
.rop-marquee-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    z-index: 2;
    pointer-events: none;
}

.rop-marquee-wrap::before {
    left: 90px;
    background: linear-gradient(to right, rgba(10,14,28,0.7), transparent);
}

.rop-marquee-wrap::after {
    right: 0;
    background: linear-gradient(to left, rgba(10,14,28,0.7), transparent);
}

/* Label badge - solid background so text doesn't bleed through */
.rop-marquee-label {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    background: linear-gradient(135deg, #0f1a2e, #0d1526);
    border-right: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px 0 0 10px;
    font-size: 10px;
    font-weight: 700;
    color: #7db4f0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

.rop-marquee-label i {
    font-size: 11px;
    color: #60a5fa;
}

.rop-marquee-label .rop-live-dot {
    color: #22c55e !important;
    animation: rop-blink 1.2s infinite;
}

@keyframes rop-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* Scrolling track */
.rop-marquee-track {
    display: flex;
    animation: rop-scroll 35s linear infinite;
    padding-left: 100px;
}

.rop-marquee-track:hover {
    animation-play-state: paused;
}

@keyframes rop-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Each order item */
.rop-marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    white-space: nowrap;
    font-size: 12px;
    color: #b0bec5;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    height: 38px;
}

.rop-marquee-item:last-child { border-right: none; }

.rop-marquee-user {
    color: #93c5fd;
    font-weight: 600;
}

.rop-marquee-action {
    color: #64748b;
    font-size: 11px;
}

.rop-marquee-product {
    color: #cbd5e1;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rop-marquee-price {
    color: #4ade80;
    font-weight: 700;
    font-size: 11.5px;
}

.rop-marquee-time {
    color: #64748b;
    font-size: 10.5px;
}

/* Separator dot between items */
.rop-marquee-item + .rop-marquee-item::before {
    display: none;
}

/* ═══════════════════════════════════════════
   #8: PRODUCT DETAILS - Dark theme overrides
   ═══════════════════════════════════════════ */
.details-content {
    background: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

.details-content:hover {
    border-color: rgba(59, 130, 246, 0.35) !important;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12) !important;
}

.details-preview li img {
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.details-preview li img:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2) !important;
}

.details-thumb li img {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.product-navigation {
    background: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.product-navigation li a {
    color: #9ca3af !important;
}

.product-navigation li a:hover {
    color: var(--primary) !important;
}

.product-details-frame {
    background: var(--bg-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.product-nav-popup {
    background: rgba(15, 15, 30, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
}

.product-nav-popup::before {
    background: rgba(15, 15, 30, 0.95) !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
    border-left-color: rgba(255, 255, 255, 0.1) !important;
}

.details-tag-list li a {
    color: #d1d5db !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.details-tag-list li a:hover {
    color: #ffffff !important;
    background: var(--primary) !important;
}

.details-share-list li a {
    color: #d1d5db !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.details-share-list li a:hover {
    color: #ffffff !important;
    background: var(--primary) !important;
}

.review-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.review-reply input {
    background: var(--bg-input) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff !important;
    border-radius: 8px;
}

.details-price del {
    color: #ef4444 !important;
}

.details-label.off { background: #ef4444 !important; }
.details-label.new { background: #22c55e !important; }
.details-label.sale { background: #f97316 !important; }
.details-label.feat { background: #8b5cf6 !important; }
.details-label.rate { background: #eab308 !important; }
