@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Theme Styles for Tenis Meja 31 */
:root {
    --brand-lime: #D4EB0C;
    --brand-lime-hover: #B8CE06;
    --brand-dark: #0A0F1D;
    --brand-slate: #0F172A;
    --brand-border: #E2E8F0;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #F8FAFC;
    color: #0F172A;
}

/* ==========================================================================
   Modern Custom Select Dropdown Arrow Styling
   Fixes native browser dropdown arrow misalignment (avoids bottom-right sink)
   ========================================================================== */
select:not([multiple]):not([size]),
select:not([multiple])[size="1"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M6 8.5L10 12.5L14 8.5' stroke='%2364748b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1.15rem 1.15rem;
    padding-right: 2.6rem !important;
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

select:not([multiple]):not([size]):hover,
select:not([multiple])[size="1"]:hover {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M6 8.5L10 12.5L14 8.5' stroke='%23334155' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
}

select:not([multiple]):not([size]):focus,
select:not([multiple])[size="1"]:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M6 8.5L10 12.5L14 8.5' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
}

select:not([multiple]):not([size]):disabled,
select:not([multiple])[size="1"]:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3e%3cpath d='M6 8.5L10 12.5L14 8.5' stroke='%2394a3b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
}

/* Brand Number 31 Text Style: Yellow with Black Stroke, Identical Size & Symmetry */
.brand-number-31 {
    color: #F9EF07;
    -webkit-text-stroke: 1.2px #0A0F1D;
    paint-order: stroke fill;
    font-weight: inherit;
    font-size: 1em;
    line-height: inherit;
    display: inline;
    letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}
::-webkit-scrollbar-track {
    background: #F1F5F9;
}
::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Product Card Polish */
.product-card {
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px -10px rgba(10, 15, 29, 0.12);
}

/* Category Sidebar Links */
.category-sidebar-link {
    transition: all 0.18s ease-in-out;
}
.category-sidebar-link:hover {
    color: #0A0F1D;
    padding-left: 0.5rem;
}
.category-sidebar-link.active {
    font-weight: 800;
    color: #0A0F1D;
    border-left: 3px solid #D4EB0C;
    padding-left: 0.5rem;
    background: linear-gradient(90deg, rgba(212, 235, 12, 0.12) 0%, transparent 100%);
}

/* Brand Card Badges & Logos */
.brand-card {
    position: relative;
    background-color: #ffffff;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.brand-card:hover {
    border-color: #0F172A;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px -2px rgba(10, 15, 29, 0.1);
}
.brand-card.active {
    border-color: #0F172A !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 2px #0A0F1D, 0 4px 12px -2px rgba(10, 15, 29, 0.15) !important;
}

/* Variant Button Selection */
.variant-btn.active {
    border-color: #0F172A;
    background-color: #0F172A;
    color: #D4EB0C;
    font-weight: 800;
    box-shadow: 0 0 0 1px #0F172A;
}

/* Lazy Loader Spinner */
.loader-spinner {
    border: 3px solid rgba(15, 23, 42, 0.1);
    border-radius: 50%;
    border-top: 3px solid #D4EB0C;
    border-right: 3px solid #0F172A;
    width: 28px;
    height: 28px;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast Animation */
.toast-item {
    pointer-events: auto;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
