/* ====================================
   Kaly4cid - Modern E-commerce Styles
   ==================================== */

:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.3);

    /* Secondary Colors */
    --secondary: #ec4899;
    --secondary-dark: #db2777;

    /* Background Colors */
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --bg-input: #16162a;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Status Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
    --gradient-card: linear-gradient(145deg, #1a1a2e 0%, #16162a 100%);
    --gradient-glow: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(236, 72, 153, 0.2) 100%);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg-dark);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: transparent;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

input,
textarea,
select {
    font-family: inherit;
    outline: none;
    border: none;
}

img {
    max-width: 100%;
}

/* Notification Badge */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--error);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 0 2px var(--bg-card);
    /* Border effect */
    z-index: 10;
    pointer-events: none;
    animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-badge.hidden {
    display: none;
    transform: scale(0);
}

@keyframes bounceIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

/* Navbar item relative positioning for badge */
.nav-item,
.header-btn {
    position: relative;
}



/* ====================================
   Splash Screen
   ==================================== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0f !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    box-sizing: border-box;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    animation: splash-appear 0.8s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes splash-appear {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.splash-logo {
    margin-bottom: 30px;
    animation: logo-enter 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    opacity: 0;
}

@keyframes logo-enter {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.8);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.logo-text {
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
    animation: logo-glow 2s ease-in-out infinite alternate;
}

@keyframes logo-glow {
    from {
        filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
    }

    to {
        filter: drop-shadow(0 0 40px rgba(236, 72, 153, 0.5));
    }
}

.splash-loader {
    width: 200px;
    height: 4px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto 20px;
    animation: loader-enter 0.6s ease-out 0.3s forwards;
    opacity: 0;
}

@keyframes loader-enter {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    animation: loading 2s ease-in-out forwards;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

.splash-tagline {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: tagline-enter 0.8s ease-out 0.5s forwards;
    opacity: 0;
    white-space: nowrap;
}

@keyframes tagline-enter {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================================
   Authentication Pages
   ==================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: bg-float 20s ease-in-out infinite;
}

@keyframes bg-float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(-20px, -20px) rotate(5deg);
    }
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: card-appear 0.5s ease-out;
}

@keyframes card-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition-normal);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-normal);
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-google {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.1);
    margin-top: 16px;
}

.btn-google:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-google img {
    width: 20px;
    height: 20px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--primary-light);
    font-weight: 600;
    transition: var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--primary);
}

/* ====================================
   Main Layout
   ==================================== */
.app-container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    background: var(--bg-dark);
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    position: relative;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, rgba(15, 15, 26, 0.85), rgba(10, 10, 20, 0.95)) !important;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition-normal);
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: var(--transition-normal);
}

.header-btn:hover {
    background: var(--primary-glow);
    color: var(--primary-light);
    transform: translateY(-2px);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--secondary);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Product Sold Count */
.product-sold {
    font-size: 0.75rem;
    color: var(--success);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.product-sold i {
    font-size: 0.65rem;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    background: linear-gradient(135deg, rgba(15, 15, 26, 0.85), rgba(10, 10, 20, 0.95)) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
    z-index: 9999 !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.nav-content {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    position: relative;
    flex: 1;
    min-width: 60px;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.1);
}

.nav-item.active i {
    transform: translateY(-2px);
}

/* Active Indicator Line */
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 20px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ====================================
   Product Grid
   ==================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.section-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.section-link:hover {
    color: var(--primary-light);
}

/* Categories */
.categories-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
    margin-bottom: 24px;
    scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-chip {
    flex-shrink: 0;
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-normal);
    cursor: pointer;
}

.category-chip:hover,
.category-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.product-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--bg-input);
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: var(--secondary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.product-info {
    padding: 16px;
}

.product-category {
    font-size: 0.75rem;
    color: var(--primary-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.product-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.product-price-old {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 8px;
}

/* ====================================
   Product Detail Page
   ==================================== */
.product-detail {
    max-width: 900px;
    margin: 0 auto;
}

.product-detail-image {
    width: 100%;
    aspect-ratio: 16/10;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 24px;
}

.product-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-info {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 20px;
}

.product-detail-category {
    display: inline-block;
    padding: 6px 14px;
    background: var(--primary-glow);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.product-detail-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.product-detail-price {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
}

.product-detail-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 24px;
}

.product-variants {
    margin-bottom: 24px;
}

.variant-label {
    font-weight: 600;
    margin-bottom: 12px;
    display: block;
}

.variant-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.variant-option {
    padding: 10px 20px;
    background: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-normal);
    cursor: pointer;
}

.variant-option:hover,
.variant-option.selected {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-glow);
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.quantity-label {
    font-weight: 600;
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.quantity-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-primary);
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

.quantity-btn:hover {
    background: var(--primary);
}

.quantity-value {
    width: 60px;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.product-actions {
    display: flex;
    gap: 12px;
}

.btn-checkout {
    flex: 1;
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition-normal);
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-chat {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 1.3rem;
    transition: var(--transition-normal);
}

.btn-chat:hover {
    background: var(--primary);
    color: white;
}

/* ====================================
   Cart / Orders Page
   ==================================== */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding: 12px 16px;
    margin-left: -16px;
    margin-right: -16px;
    position: relative;
    z-index: 5;
    background: transparent;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 10px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: var(--transition-normal);
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tab:hover,
.tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.order-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-normal);
    cursor: pointer;
}

.order-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.order-id {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.order-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.order-status {
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.order-status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.order-status.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.order-status.rejected {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.order-product {
    display: flex;
    gap: 16px;
}

.order-product-image {
    width: 80px;
    height: 80px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.order-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-product-info {
    flex: 1;
}

.order-product-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.order-product-variant {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.order-product-price {
    font-weight: 700;
    color: var(--primary);
}

/* Account Details Modal */
.account-details {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 16px;
}

.account-details h4 {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-details h4 i {
    color: var(--success);
}

.account-field {
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-field-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.account-field-value {
    font-weight: 600;
    font-family: monospace;
    font-size: 1rem;
}

.copy-btn {
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.copy-btn:hover {
    background: var(--primary-dark);
}

/* ====================================
   Profile Page
   ==================================== */
.profile-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--gradient-glow);
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    margin: 0 auto 16px;
    overflow: hidden;
    border: 4px solid var(--primary);
    position: relative;
    cursor: pointer;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.profile-avatar:hover .profile-avatar-overlay {
    opacity: 1;
}

.profile-avatar-overlay i {
    font-size: 1.5rem;
    color: white;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.profile-email {
    color: var(--text-secondary);
}

.profile-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.profile-section-title {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.profile-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-item:last-child {
    border-bottom: none;
}

.profile-item-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 1.1rem;
    margin-right: 16px;
}

.profile-item-content {
    flex: 1;
}

.profile-item-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profile-item-value {
    font-weight: 600;
}

.profile-item-action {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.btn-logout {
    width: 100%;
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ====================================
   Chat Page
   ==================================== */
.chat-container {
    height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.chat-header {
    padding: 16px 20px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.chat-info h3 {
    font-size: 1rem;
    font-weight: 600;
}

.chat-info span {
    font-size: 0.8rem;
    color: var(--success);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    line-height: 1.5;
}

.message.sent {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.received {
    background: var(--bg-input);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-input {
    padding: 16px 20px;
    background: var(--bg-input);
    display: flex;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.chat-input button {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    color: white;
    font-size: 1.2rem;
    transition: var(--transition-normal);
}

.chat-input button:hover {
    transform: scale(1.05);
}

/* ====================================
   Announcements Page
   ==================================== */
.announcement-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid var(--primary);
}

.announcement-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.announcement-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.announcement-content {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ====================================
   Checkout / Payment Page
   ==================================== */
.checkout-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin-bottom: 20px;
}

.checkout-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkout-title i {
    color: var(--primary);
}

.checkout-summary {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.checkout-summary img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.checkout-summary-info h4 {
    font-weight: 600;
    margin-bottom: 4px;
}

.checkout-summary-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.checkout-summary-info .price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.qris-container {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.qris-container img {
    max-width: 250px;
    margin: 0 auto;
}

.qris-label {
    margin-top: 16px;
    color: #333;
    font-weight: 600;
}

.payment-total {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background: var(--gradient-glow);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.payment-total span:first-child {
    font-weight: 500;
}

.payment-total span:last-child {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary);
}

.upload-proof {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
}

.upload-proof:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.upload-proof i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 12px;
}

.upload-proof p {
    color: var(--text-secondary);
}

.uploaded-preview {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.uploaded-preview img {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.uploaded-preview .info {
    flex: 1;
}

.uploaded-preview .info p {
    font-weight: 500;
    font-size: 0.9rem;
}

.uploaded-preview .info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.payment-actions {
    display: flex;
    gap: 12px;
}

.btn-back {
    flex: 1;
    padding: 16px;
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-weight: 600;
}

.btn-back:hover {
    background: var(--bg-card-hover);
}

.btn-confirm {
    flex: 2;
    padding: 16px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
}

.btn-confirm:hover {
    box-shadow: var(--shadow-glow);
}

.btn-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ====================================
   Modal
   ==================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 420px;
    width: 100%;
    transform: scale(0.9);
    transition: var(--transition-normal);
    text-align: center;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 20px;
}

.modal-icon.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.modal-icon.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.modal-icon.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.modal h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions button {
    flex: 1;
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* ====================================
   Admin Panel
   ==================================== */
.admin-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--bg-card);
    padding: 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.admin-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-normal);
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: var(--primary);
    color: white;
}

.admin-nav-item i {
    width: 20px;
    text-align: center;
}

.admin-main {
    padding: 24px;
    overflow-y: auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.stat-card-icon.purple {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.stat-card-icon.pink {
    background: rgba(236, 72, 153, 0.2);
    color: var(--secondary);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.stat-card-icon.orange {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.stat-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
    background: var(--bg-input);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.admin-table .product-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-table .product-cell img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.table-actions button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.table-actions .edit-btn {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
}

.table-actions .delete-btn {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.table-actions button:hover {
    transform: scale(1.1);
}

/* ====================================
   Toast Notifications
   ==================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
    animation: toast-in 0.3s ease-out;
    border-left: 4px solid var(--primary);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

.toast.warning {
    border-color: var(--warning);
}

.toast i {
    font-size: 1.2rem;
}

.toast.success i {
    color: var(--success);
}

.toast.error i {
    color: var(--error);
}

.toast.warning i {
    color: var(--warning);
}

/* ====================================
   Responsive Design
   ==================================== */
@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .search-bar {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 12px;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-detail-name {
        font-size: 1.4rem;
    }

    .product-detail-price {
        font-size: 1.5rem;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px;
    }

    .logo-text {
        font-size: 3rem;
    }

    /* Mobile 3-column product grid */
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }

    .product-card {
        border-radius: 10px;
    }

    .product-info {
        padding: 8px;
    }

    .product-category {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }

    .product-name {
        font-size: 0.7rem;
        margin-bottom: 4px;
        -webkit-line-clamp: 1;
    }

    .product-price {
        font-size: 0.75rem;
    }

    .product-badge {
        padding: 2px 6px;
        font-size: 0.55rem;
        top: 5px;
        left: 5px;
    }

    .payment-actions {
        flex-direction: column;
    }

    .modal-actions {
        flex-direction: column;
    }

    /* Smaller header on mobile */
    .header-logo {
        font-size: 1.2rem;
    }

    .search-bar input {
        padding: 10px 14px 10px 38px;
        font-size: 0.85rem;
    }

    .search-bar i {
        left: 12px;
        font-size: 0.9rem;
    }

    .header-btn {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .category-chip {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* ====================================
   Chat Page
   ==================================== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    background: var(--bg-dark);
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.chat-info h3 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.chat-info span {
    font-size: 0.8rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    position: relative;
    animation: fadeIn 0.3s ease;
    word-wrap: break-word;
}

.message p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

.message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.received {
    align-self: flex-start;
    background: var(--bg-card);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

.message-time {
    display: block;
    font-size: 0.7rem;
    margin-top: 6px;
    opacity: 0.7;
    text-align: right;
}

.chat-input {
    padding: 16px;
    background: var(--bg-card);
    display: flex;
    gap: 12px;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border-radius: 20px;
    color: white;
}

.chat-input button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.chat-input button:active {
    transform: scale(0.95);
}

/* Product Card in Chat */
.product-card-chat {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
    max-width: 250px;
    display: block;
    color: inherit;
    text-decoration: none;
    transition: background 0.2s;
}

.product-card-chat:hover {
    background: rgba(255, 255, 255, 0.1);
}

.product-card-chat img {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

/* ====================================
   Utility Classes
   ==================================== */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.5;
    pointer-events: none;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ====================================
   WebView Mode - Hide Download Elements
   ==================================== */
body.is-webview .download-btn-nav,
body.is-webview a[href*="dwapk"],
body.is-webview a[href*="download"],
body.is-webview .nav-item[href*="dwapk"],
body.is-webview .bottom-nav a[href*="dwapk"],
body.is-webview .header-actions a[href*="dwapk"],
body.is-webview .nav-content a[href*="dwapk"],
body.is-webview .download-page {
    display: none !important;
}

/* Also hide the html element before body class is applied */
html.is-webview a[href*="dwapk"],
html.is-webview a[href*="download"] {
    display: none !important;
}