/**
 * UltimateShop Stylesheet
 */

:root {
    --shop-primary: #3b82f6;
    --shop-success: #10b981;
    --shop-danger: #ef4444;
    --shop-warning: #f59e0b;
    --shop-dark: #1e293b;
    --shop-light: #f8fafc;
}

/* Tabs */
.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.shop-tab-link {
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    color: #64748b;
    text-decoration: none !important;
    transition: all 0.2s;
}

.shop-tab-link:hover {
    background: #f1f5f9;
    color: var(--shop-primary);
}

.shop-tab-link.active {
    background: var(--shop-primary);
    color: white;
}

.shop-tab-content {
    display: none;
}

.shop-tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shop Header & Balance */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 30px;
    padding: 30px 40px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: 16px;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.2);
    position: relative;
    overflow: hidden;
}

.shop-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
}

.shop-header-info h2 {
    color: #ffffff !important;
    margin: 0 0 5px 0 !important;
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shop-header-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.shop-btn-badge {
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.shop-header-actions {
    display: flex;
    align-items: stretch;
    gap: 15px;
}

.shop-header-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff !important;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.shop-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.shop-balance-card {
    background: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 140px;
}

.shop-balance-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 2px;
}

.shop-balance-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1e3a8a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shop-section-title {
    margin: 40px 0 20px;
    border-left: 4px solid var(--shop-primary);
    padding-left: 15px;
}

.shop-section-title h3 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 !important;
    text-transform: none !important;
}

.shop-section-title p {
    color: #64748b;
    margin: 5px 0 0;
}

.shop-header-count {
    font-size: 0.85em;
    font-weight: normal;
    opacity: 0.8;
    margin-left: 10px;
}

.shop-divider {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 40px 0;
}

/* Back Button & Sort Container */
.shop-back-container {
    flex: 1;
}

.shop-sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.shop-sort-container form {
    display: flex;
    align-items: center;
    gap: 5px;
}

.shop-sort-container select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    font-size: 0.9rem;
    cursor: pointer;
}

.shop-sort-container label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.9rem;
}

/* Inventory & Shop Grid */
.panel .shop-inventory-grid,
.panel .shop-category-grid {
    padding: 15px;
    margin-top: 0;
}

.shop-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.shop-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.shop-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--shop-primary);
}

/* Special States */
.shop-card.is-featured {
    border-color: #f59e0b;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.shop-card.is-featured::after {
    content: "\f005";
    font-family: FontAwesome;
    position: absolute;
    top: -10px;
    right: -10px;
    background: #f59e0b;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10;
    border: 2px solid white;
}

.shop-card.is-on-sale {
    border-color: #ef4444;
    background: linear-gradient(to bottom, #ffffff, #fff5f5);
}

.shop-card.is-on-sale .shop-card-price {
    color: #ef4444;
    font-size: 1.6rem;
}

.shop-sale-timer {
    font-size: 0.85rem;
    color: #ef4444;
    font-weight: 700;
    margin-top: 5px;
    padding: 4px 10px;
    background: #fee2e2;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: relative;
    /* For tooltip */
    cursor: help;
}

.shop-resale-badge {
    background: var(--shop-success);
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.shop-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.shop-resale-icon-inline {
    color: var(--shop-success);
    font-size: 14px;
    margin-left: 5px;
    cursor: help;
}

.shop-sale-timer:hover .shop-tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.shop-card.is-discounted {
    border-style: solid;
}

.shop-card.is-featured:hover {
    box-shadow: 0 12px 24px rgba(245, 158, 11, 0.25);
    border-color: #f59e0b;
}

.shop-card-image {
    position: relative;
    height: 180px;
    width: 100%;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    /* Only crop the image part */
}

.shop-card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.shop-card-icon-wrapper {
    position: absolute;
    top: 152px;
    left: 20px;
    width: 56px;
    height: 56px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border: 3px solid #ffffff;
    z-index: 5;
}

.shop-card-icon {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.shop-card-body {
    padding: 45px 20px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.shop-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    display: block;
}

.shop-card-desc {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

.shop-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}


.shop-meta-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
    color: #475569;
    background: #ffffff;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    position: relative;
    /* For tooltip positioning */
}

.shop-meta-pill:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.shop-meta-pill i {
    color: #64748b;
    font-size: 1rem;
    transition: color 0.2s;
}

/* Custom Tooltip Styling */
.shop-tooltip-text {
    visibility: hidden;
    background-color: rgba(30, 41, 59, 0.98);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 6px 12px;
    position: absolute;
    z-index: 100;
    /* Higher z-index */
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

/* Tooltip Arrow */
.shop-tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(30, 41, 59, 0.95) transparent transparent transparent;
}

.shop-meta-pill:hover .shop-tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}


.pill-gift {
    background: #faf5ff;
    border-color: #f3e8ff;
}

.pill-gift i {
    color: #a855f7;
}

.pill-price {
    background: #f0fdf4;
    border-color: #dcfce7;
}

.pill-price i {
    color: #22c55e;
}

.pill-success {
    background: #f0fdf4;
    border-color: #dcfce7;
}

.pill-success i {
    color: #22c55e;
}

.pill-warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.pill-warning i {
    color: #d97706;
}

.pill-danger {
    background: #fef2f2;
    border-color: #fee2e2;
}

.pill-danger i {
    color: #ef4444;
}


.shop-pagination-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 15px 0;
    padding: 0 5px;
}

.shop-pagination-row .pagination {
    margin-left: auto;
}

.shop-pagination-row .shop-back-container {
    margin-right: 15px;
}

.shop-sort-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.shop-sort-container.bottom {
    border-top: 1px solid #e2e8f0;
    padding-top: 20px;
    margin-top: 30px;
}

.display-options {
    font-size: 0.9em;
    color: #64748b;
}

.display-options select {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    margin: 0 5px;
}

.action-bar .pagination {
    margin: 0;
}

/* Premium Button System (Unified with ACP) */
.shop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 15px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-weight: 700;
    font-size: 0.95em;
    transition: all 0.2s;
    text-decoration: none !important;
    cursor: pointer;
    flex: 1;
    position: relative;
    white-space: nowrap;
}

.shop-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.shop-btn i {
    font-size: 1.1rem;
}

.shop-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.shop-btn:hover .shop-tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}


/* Logic Colors */
.btn-use:hover {
    background: #f0fdf4 !important;
    color: #10b981 !important;
    border-color: #bbf7d0 !important;
}

.btn-sell:hover {
    background: #fff7ed !important;
    color: #f97316 !important;
    border-color: #ffedd5 !important;
}

.btn-trash:hover {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border-color: #fecaca !important;
}

.btn-display:hover,
.btn-display.is-active {
    background: #eff6ff !important;
    color: #3b82f6 !important;
    border-color: #bfdbfe !important;
}

.btn-market:hover {
    background: #f0fdfa !important;
    color: #0d9488 !important;
    border-color: #99f6e4 !important;
}

.btn-refund:hover {
    background: #fffbeb !important;
    color: #d97706 !important;
    border-color: #fde68a !important;
}

.shop-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
}

/* Modal Form Styling */
.shop-swal-intro {
    font-size: 1.1em;
    color: #1e293b;
    margin-bottom: 20px;
    line-height: 1.5;
}

.shop-swal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    text-align: left;
    margin-top: 15px;
}

.shop-swal-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-swal-field label {
    font-size: 0.95em;
    font-weight: 600;
    color: #475569;
}

.shop-swal-field .swal2-input {
    margin: 0 !important;
    width: 100% !important;
    height: 45px !important;
    font-size: 1.1em !important;
    border-radius: 8px !important;
}

.shop-swal-form .shop-inventory-alert {
    margin-top: 5px;
    margin-bottom: 10px;
}

.shop-tax-notice {
    font-size: 0.85em;
    color: #64748b;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.shop-tax-notice i {
    color: #3b82f6;
}

.shop-market-tax-box {
    background: #fff7ed;
    border: 1px solid #ffedd5;
    color: #9a3412;
    padding: 10px 12px;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    font-weight: 600;
}

.shop-market-tax-box i {
    font-size: 1.1em;
    color: #f97316;
}

.shop-badge-warning {
    background: #fffbeb !important;
    color: #d97706 !important;
    border: 1px solid #fde68a !important;
}

.shop-badge-danger {
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1px solid #fecaca !important;
}

.btn-display:hover i,
.btn-display.is-active i {
    color: #3b82f6 !important;
}

.btn-buy:hover {
    background: #f0fdf4 !important;
    color: #10b981 !important;
    border-color: #bbf7d0 !important;
}

.btn-gift:hover {
    background: #faf5ff !important;
    color: #a855f7 !important;
    border-color: #f3e8ff !important;
}

.btn-sold-out {
    cursor: not-allowed !important;
    opacity: 0.7;
    background: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1px solid #fecaca !important;
    pointer-events: none;
}

.shop-btn-primary {
    background: var(--shop-primary);
    color: #fff !important;
    border: none;
}

.shop-btn-primary:hover {
    background: #2563eb;
}

/* Empty state */
.shop-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #f8fafc;
    border-radius: 20px;
    border: 2px dashed #e2e8f0;
}

.shop-empty-icon {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.shop-card-warning {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 10;
    border-radius: 15px 15px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(4px);
}

/* Category Grid */
.shop-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.shop-category-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s;
    text-decoration: none !important;
    color: inherit !important;
}

.shop-category-card:hover,
.shop-category-card.is-active {
    border-color: var(--shop-primary);
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.shop-category-card.is-active {
    background: #eff6ff;
    border-width: 2px;
    border-color: #3b82f6;
}

.shop-category-card.is-active .shop-category-name {
    color: #1d4ed8;
    font-weight: 800;
}

.shop-category-icon {
    width: 40px;
    height: 40px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.2rem;
}

.shop-category-card:hover .shop-category-icon {
    background: #eff6ff;
    color: var(--shop-primary);
}

.shop-category-info {
    flex: 1;
}

.shop-category-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    display: block;
}

.shop-category-count {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Price & Badges */
.shop-card-price-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 15px 0;
    padding: 12px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #e2e8f0;
}

.shop-card-price {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--shop-success);
}

.shop-card-old-price {
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: line-through;
}

.shop-card-badge-floating {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

/* UCP Inventory Specific Overrides */
.shop-ucp-container .shop-inventory-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.shop-ucp-container .shop-card {
    padding: 0;
}

.shop-ucp-container .shop-card-image {
    height: 120px;
}

.shop-ucp-container .shop-card-icon-wrapper {
    top: 92px;
    width: 48px;
    height: 48px;
}

.shop-ucp-container .shop-card-icon {
    width: 30px;
    height: 30px;
}

.shop-ucp-container .shop-card-body {
    padding: 30px 12px 15px 12px;
}

.shop-ucp-container .shop-card-title {
    font-size: 1.1rem;
}

.shop-ucp-container .shop-card-desc {
    font-size: 0.85rem;
}

.shop-ucp-container .shop-btn {
    flex: 1;
    padding: 0 12px;
    height: 34px;
    font-size: 0.85em;
}

.shop-ucp-container .shop-card-footer {
    justify-content: center;
    flex-wrap: wrap;
}

/* Component Extensions */
.shop-card-icon-fa {
    font-size: 24px;
    color: #334155;
}

.shop-card-icon-default {
    font-size: 24px;
    color: #cbd5e1;
}

.shop-btn-full {
    flex: 1;
}

.shop-empty-btn {
    max-width: 200px;
    margin: 20px auto 0;
}

.badge-discount {
    background: #ef4444;
}

.sold-out-text {
    font-weight: 700;
    margin-left: 5px;
}

/* Item Config Form (UCP) */
.shop-item-config-group {
    margin-top: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.shop-config-title {
    color: #1e293b;
    border-left: 4px solid #3b82f6;
    padding-left: 10px;
    margin-bottom: 15px;
}

.shop-config-dl {
    margin-bottom: 10px;
}

.shop-config-dt {
    width: 40%;
}

/* Notices */
.shop-notice-center {
    text-align: center;
    padding: 40px 20px;
}

.shop-notice-icon {
    font-size: 3em !important;
    color: #3b82f6;
    margin-bottom: 15px;
    opacity: 0.5;
}

.shop-notice-title {
    font-size: 1.2em;
    color: #4b5563;
    margin-top: 10px;
}

.shop-notice-text {
    color: #94a3b8;
}

/* Utilities */
.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-40 {
    margin-bottom: 40px;
}

.text-center {
    text-align: center;
}

.text-danger {
    color: #ef4444 !important;
}

.text-success {
    color: #10b981 !important;
}

.shop-shelf-icon {
    max-width: 24px;
    vertical-align: middle;
}

.shop-hidden {
    display: none !important;
}

/* Modal Inventory Alert */
.shop-inventory-alert {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f8fafc;
    border-left: 4px solid #7066e0;
    border-radius: 8px;
    font-size: 0.9em;
    color: #475569;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
}

.shop-inventory-alert i {
    color: #7066e0;
    font-size: 1.1em;
}