/**
 * Apple Style UI for ZFAKA
 * Minimalist, Clean, Modern Design
 * Inspired by Apple.com
 */

/* ============================================
   ROOT VARIABLES & RESET
   ============================================ */
:root {
    /* Apple Color Palette */
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ed;
    --apple-gray: #86868b;
    --apple-dark: #1d1d1f;
    --apple-light-gray: #f5f5f7;
    --apple-white: #ffffff;
    --apple-border: #d2d2d7;
    --apple-green: #34c759;
    --apple-orange: #ff9500;
    --apple-red: #ff3b30;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    
    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================
   BASE STYLES
   ============================================ */
html {
    background-color: var(--apple-white);
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--apple-dark);
    background-color: var(--apple-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin-top: 60px;
}

/* Remove old background image */
html[style*="background-image"] {
    background-image: none !important;
    background-size: auto !important;
}

/* ============================================
   NAVIGATION - Glassmorphism Header
   ============================================ */
.fly-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 10000;
    transition: var(--transition-normal);
}

.fly-header.scrolled {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-sm);
}

.fly-header .layui-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.fly-logo {
    display: flex;
    align-items: center;
}

.fly-logo img {
    height: 28px;
    width: auto;
    transition: var(--transition-fast);
}

.fly-logo:hover img {
    transform: scale(1.02);
}

/* Navigation Menu */
.fly-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fly-nav li {
    position: relative;
}

.fly-nav a {
    color: var(--apple-dark);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    padding: 8px 0;
    position: relative;
    transition: var(--transition-fast);
    opacity: 0.8;
}

.fly-nav a:hover {
    opacity: 1;
    color: var(--apple-blue);
}

.fly-nav .layui-this a {
    opacity: 1;
    font-weight: 500;
}

.fly-nav .layui-this a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    background: var(--apple-blue);
    border-radius: 1px;
}

/* User Menu */
.fly-nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fly-nav-user a {
    color: var(--apple-dark);
    font-size: 13px;
    text-decoration: none;
    transition: var(--transition-fast);
}

.fly-nav-user .fly-nav-avatar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--apple-light-gray);
    border-radius: 20px;
    transition: var(--transition-fast);
}

.fly-nav-user .fly-nav-avatar:hover {
    background: var(--apple-border);
}

.fly-nav-user .fly-nav-avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.fly-nav-user .fly-nav-avatar cite {
    font-style: normal;
    font-weight: 500;
}

.fly-badge-vip {
    background: var(--apple-blue) !important;
    color: white !important;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Mobile Menu Toggle */
#fly-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--apple-dark);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */
.fly-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    min-height: calc(100vh - 200px);
}

.fly-marginTop {
    margin-top: 24px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(180deg, var(--apple-light-gray) 0%, var(--apple-white) 100%);
    border-radius: var(--radius-xl);
    margin-bottom: 48px;
}

.hero-section h1 {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 16px;
    color: var(--apple-dark);
}

.hero-section p {
    font-size: 21px;
    color: var(--apple-gray);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.4;
}

/* ============================================
   CARDS
   ============================================ */
.fly-panel, .layui-card {
    background: var(--apple-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: var(--transition-normal);
}

.fly-panel:hover, .layui-card:hover {
    box-shadow: var(--shadow-md);
}

.fly-panel-title, .layui-card-header {
    padding: 20px 24px;
    font-size: 17px;
    font-weight: 600;
    color: var(--apple-dark);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    background: transparent;
}

.fly-panel-main, .layui-card-body {
    padding: 24px;
}

/* ============================================
   PRODUCT GRID - Apple Style
   ============================================ */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

.product-card {
    background: var(--apple-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    display: block;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.product-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--apple-light-gray);
}

.product-card-body {
    padding: 20px;
}

.product-card-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-auto {
    background: rgba(52, 199, 89, 0.1);
    color: var(--apple-green);
}

.badge-manual {
    background: rgba(134, 134, 139, 0.1);
    color: var(--apple-gray);
}

.badge-discount {
    background: rgba(255, 149, 0, 0.1);
    color: var(--apple-orange);
}

.product-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--apple-dark);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.product-card-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--apple-dark);
}

.product-card-price::before {
    content: '¥';
    font-size: 14px;
    margin-right: 2px;
}

.product-card-stats {
    font-size: 12px;
    color: var(--apple-gray);
}

/* ============================================
   BUTTONS - Apple Style
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    gap: 8px;
}

.btn-primary {
    background: var(--apple-blue);
    color: white;
}

.btn-primary:hover {
    background: var(--apple-blue-hover);
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.btn-secondary {
    background: var(--apple-light-gray);
    color: var(--apple-dark);
}

.btn-secondary:hover {
    background: var(--apple-border);
}

.btn-outline {
    background: transparent;
    color: var(--apple-blue);
    border: 1px solid var(--apple-blue);
}

.btn-outline:hover {
    background: rgba(0, 113, 227, 0.05);
}

/* Old Layui Button Override */
.layui-btn {
    background: var(--apple-blue) !important;
    color: white !important;
    border-radius: 100px !important;
    padding: 10px 24px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border: none !important;
    height: auto !important;
    line-height: 1.5 !important;
    transition: var(--transition-fast) !important;
}

.layui-btn:hover {
    background: var(--apple-blue-hover) !important;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.layui-btn-warm {
    background: var(--apple-orange) !important;
}

.layui-btn-warm:hover {
    background: #ff9f0a !important;
}

/* ============================================
   TABLES - Modern Style
   ============================================ */
.layui-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
}

.layui-table th {
    background: var(--apple-light-gray);
    color: var(--apple-gray);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px;
    text-align: left;
    border: none;
}

.layui-table td {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--apple-dark);
}

.layui-table tbody tr {
    transition: var(--transition-fast);
}

.layui-table tbody tr:hover {
    background: rgba(0, 113, 227, 0.02);
}

.layui-table tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   FORMS
   ============================================ */
.layui-input {
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--apple-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--apple-white);
    transition: var(--transition-fast);
    color: var(--apple-dark);
}

.layui-input:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
}

.layui-form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-dark);
    padding: 12px 16px;
}

.layui-form-item {
    margin-bottom: 20px;
}

/* ============================================
   TABS - Modern Style
   ============================================ */
.layui-tab-title {
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: 0;
}

.layui-tab-title li {
    font-size: 14px;
    color: var(--apple-gray);
    padding: 16px 24px;
    transition: var(--transition-fast);
}

.layui-tab-title li:hover {
    color: var(--apple-dark);
}

.layui-tab-title .layui-this {
    color: var(--apple-blue);
    font-weight: 600;
}

.layui-tab-title .layui-this::after {
    height: 2px;
    background: var(--apple-blue);
    border-radius: 1px;
}

/* ============================================
   ALERTS & QUOTES
   ============================================ */
.layui-elem-quote {
    background: rgba(0, 113, 227, 0.05);
    border-left: 4px solid var(--apple-blue);
    padding: 16px 20px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--apple-dark);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ============================================
   PAGINATION
   ============================================ */
.laypage-main {
    border: none;
    margin: 32px 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.laypage-main a,
.laypage-main span {
    min-width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--apple-border);
    color: var(--apple-dark);
    font-size: 14px;
    transition: var(--transition-fast);
    text-decoration: none;
}

.laypage-main a:hover {
    background: var(--apple-light-gray);
    border-color: var(--apple-border);
}

.laypage-main .laypage-curr {
    background: var(--apple-dark);
    color: white;
    border-color: var(--apple-dark);
}

/* ============================================
   FOOTER
   ============================================ */
.fly-footer {
    background: var(--apple-light-gray);
    padding: 48px 24px;
    text-align: center;
    color: var(--apple-gray);
    font-size: 12px;
    margin-top: 80px;
}

.fly-footer p {
    margin: 0;
}

.fly-footer a {
    color: var(--apple-dark);
    text-decoration: none;
    font-weight: 500;
}

.fly-footer a:hover {
    color: var(--apple-blue);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.hidden { display: none !important; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media screen and (max-width: 768px) {
    body {
        margin-top: 56px;
    }
    
    .fly-header {
        height: 56px;
    }
    
    .fly-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 16px;
        gap: 0;
        box-shadow: var(--shadow-md);
    }
    
    .fly-nav.active {
        display: flex;
    }
    
    .fly-nav li {
        width: 100%;
    }
    
    .fly-nav a {
        display: block;
        padding: 12px 16px;
        border-radius: var(--radius-md);
    }
    
    .fly-nav a:hover {
        background: var(--apple-light-gray);
    }
    
    #fly-nav-toggle {
        display: block;
    }
    
    .hero-section h1 {
        font-size: 32px;
    }
    
    .hero-section p {
        font-size: 17px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .fly-main {
        padding: 20px 16px;
    }
}

@media screen and (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .layui-table {
        font-size: 13px;
    }
    
    .layui-table th,
    .layui-table td {
        padding: 12px 8px;
    }
}

/* ============================================
   HIDE OLD BACKGROUND IMAGE
   ============================================ */
#zlkbbody {
    background: none !important;
}

/* Override any inline background styles */
[style*="background-image"] {
    background-image: none !important;
}
