/* ASG Premium Theme 2026 (Default) */
body[data-theme="asg-premium"] {
    --bg-color: #050505;
    --surface-color: #121212;
    --surface-hover: #1a1a1a;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --accent-color: #8b5cf6;
    --accent-hover: #a78bfa;
    --danger-color: #f43f5e;
    --success-color: #10b981;
    --sidebar-bg: rgba(5, 5, 5, 0.85);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    --glass-bg: rgba(18, 18, 18, 0.7);
    --skeleton-base: #1f1f22;
    --skeleton-highlight: #2f2f35;
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --gradient-start: #8b5cf6;
    --gradient-end: #3b82f6;
}

/* ASG Glassmorphism Theme */
body[data-theme="asg-glass"] {
    --bg-color: #eef2f6;
    --surface-color: rgba(255, 255, 255, 0.7);
    --surface-hover: rgba(255, 255, 255, 0.9);
    --border-color: rgba(255, 255, 255, 0.8);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --danger-color: #e11d48;
    --success-color: #059669;
    --sidebar-bg: rgba(255, 255, 255, 0.6);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.6);
    --skeleton-base: #e2e8f0;
    --skeleton-highlight: #f8fafc;
    --modal-overlay: rgba(15, 23, 42, 0.3);
    --gradient-start: #6366f1;
    --gradient-end: #ec4899;
}

/* Bento Grid Theme (Apple Style) */
body[data-theme="bento"] {
    --bg-color: #f7f7f8;
    --surface-color: #ffffff;
    --surface-hover: #f5f5f7;
    --border-color: #e5e5ea;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #000000;
    --accent-hover: #333333;
    --danger-color: #ff3b30;
    --success-color: #34c759;
    --sidebar-bg: #f5f5f7;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --skeleton-base: #ebebeb;
    --skeleton-highlight: #fafafa;
    --modal-overlay: rgba(0, 0, 0, 0.4);
    --gradient-start: #000000;
    --gradient-end: #555555;
}

/* Ocean Glass Theme */
body[data-theme="ocean"] {
    --bg-color: #0f172a;
    --surface-color: rgba(15, 23, 42, 0.8);
    --surface-hover: rgba(30, 41, 59, 0.9);
    --border-color: rgba(14, 165, 233, 0.3);
    --text-primary: #f0f9ff;
    --text-secondary: #bae6fd;
    --accent-color: #0ea5e9;
    --accent-hover: #38bdf8;
    --danger-color: #fb7185;
    --success-color: #34d399;
    --sidebar-bg: rgba(15, 23, 42, 0.9);
    --shadow: 0 10px 40px rgba(2, 132, 199, 0.2);
    --glass-bg: rgba(15, 23, 42, 0.7);
    --skeleton-base: #1e293b;
    --skeleton-highlight: #334155;
    --modal-overlay: rgba(2, 6, 23, 0.8);
    --gradient-start: #0ea5e9;
    --gradient-end: #10b981;
}

/* ASG Craft (Крафтовая) */
body[data-theme="asg-craft"] {
    --bg-color: #ebdcci;
    --surface-color: rgba(245, 233, 220, 0.85);
    --surface-hover: rgba(250, 242, 230, 0.95);
    --border-color: rgba(139, 90, 43, 0.25);
    --text-primary: #3d2b1f;
    --text-secondary: #705a4d;
    --accent-color: #b5651d;
    /* Rich caramel / leather */
    --accent-hover: #8b4513;
    /* Saddle brown */
    --danger-color: #8b0000;
    --success-color: #2e8b57;
    --sidebar-bg: rgba(235, 220, 204, 0.9);
    --shadow: 0 10px 40px rgba(92, 58, 33, 0.15);
    --glass-bg: rgba(245, 233, 220, 0.75);
    --skeleton-base: #dfcabc;
    --skeleton-highlight: #eedacb;
    --modal-overlay: rgba(61, 43, 31, 0.6);
    --gradient-start: #b5651d;
    --gradient-end: #8b4513;
}

/* ASG Nature (Природные тона - Темная) */
body[data-theme="asg-nature"] {
    --bg-color: #1a2421;
    /* Dark forest / deep jade background */
    --surface-color: rgba(30, 43, 39, 0.85);
    --surface-hover: rgba(40, 56, 51, 0.95);
    --border-color: rgba(142, 166, 151, 0.15);
    --text-primary: #e6eee8;
    --text-secondary: #9cb5a8;
    --accent-color: #d17a41;
    /* Deep Terracotta / clay accent */
    --accent-hover: #b86935;
    --danger-color: #e55039;
    --success-color: #78e08f;
    --sidebar-bg: rgba(20, 31, 28, 0.9);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(30, 43, 39, 0.7);
    --skeleton-base: #2a3b36;
    --skeleton-highlight: #3b524b;
    --modal-overlay: rgba(8, 13, 11, 0.8);
    --gradient-start: #d17a41;
    --gradient-end: #e5aaa1;
}

/* Archive ASG (Тайный Архив) */
body[data-theme="archive-asg"] {
    --bg-color: #0a0a0a;
    --surface-color: rgba(20, 20, 20, 0.85);
    --surface-hover: rgba(30, 30, 30, 0.95);
    --border-color: rgba(160, 140, 120, 0.12);
    --text-primary: #dcd3c6;
    --text-secondary: #8c8275;
    --accent-color: #8a1c1c;
    --accent-hover: #a82626;
    --danger-color: #e63946;
    --success-color: #2a7251;
    --sidebar-bg: rgba(10, 10, 10, 0.95);
    --shadow: 0 15px 45px rgba(0, 0, 0, 0.8);
    --glass-bg: rgba(20, 20, 20, 0.7);
    --skeleton-base: #1a1a1a;
    --skeleton-highlight: #2a2a2a;
    --modal-overlay: rgba(0, 0, 0, 0.85);
    --gradient-start: #8a1c1c;
    --gradient-end: #1a1a1a;
}

/* Sakura ASG (Сакура Аниме) */
body[data-theme="sakura-asg"] {
    --bg-color: #fff0f5;
    --surface-color: rgba(255, 255, 255, 0.85);
    --surface-hover: rgba(255, 255, 255, 1);
    --border-color: rgba(255, 183, 197, 0.5);
    --text-primary: #5c3a4f;
    --text-secondary: #9e7a8f;
    --accent-color: #ff8eaa;
    --accent-hover: #ff6b90;
    --danger-color: #ff4d6d;
    --success-color: #7bc0a3;
    --sidebar-bg: rgba(255, 240, 245, 0.95);
    --shadow: 0 10px 40px rgba(255, 183, 197, 0.25);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --skeleton-base: #ffe4e1;
    --skeleton-highlight: #fff0f5;
    --modal-overlay: rgba(255, 183, 197, 0.5);
    --gradient-start: #ffb7c5;
    --gradient-end: #ff8eaa;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
    z-index: 0;

    /* Mobile Touch Optimizations */
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

/* Elegant Animated Planet Logo */
.elegant-planet-logo {
    position: relative;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.elegant-planet-logo .planet {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-light, #a78bfa), var(--accent-color));
    box-shadow: 0 0 15px var(--accent-color), inset -3px -3px 6px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
    animation: planetBreathe 4s infinite alternate ease-in-out;
}

.elegant-planet-logo .ring {
    position: absolute;
    width: 28px;
    height: 8px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transform: rotate(-20deg);
    z-index: 1;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2), inset 0 0 5px rgba(255, 255, 255, 0.2);
    animation: ringTilt 8s infinite alternate ease-in-out;
}

.elegant-planet-logo .orbit {
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    animation: orbitSpin 6s linear infinite;
    z-index: 3;
}

.elegant-planet-logo .moon {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px #fff;
}

@keyframes planetBreathe {
    0% {
        transform: scale(1);
        box-shadow: 0 0 10px var(--accent-color), inset -3px -3px 6px rgba(0, 0, 0, 0.4);
    }

    100% {
        transform: scale(1.05);
        box-shadow: 0 0 20px var(--accent-color), inset -3px -3px 6px rgba(0, 0, 0, 0.4);
    }
}

@keyframes ringTilt {
    0% {
        transform: rotate(-20deg) scaleX(1);
    }

    100% {
        transform: rotate(-10deg) scaleX(1.1);
    }
}

@keyframes orbitSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Premium Animated Background (Living Effect) */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--accent-color) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, var(--danger-color) 0%, transparent 30%),
        radial-gradient(circle at 20% 80%, var(--success-color) 0%, transparent 50%);
    opacity: 0.15;
    z-index: -1;
    animation: livingBackground 30s infinite alternate ease-in-out;
    pointer-events: none;
}

@keyframes livingBackground {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-5%, 5%) scale(1.05);
    }

    100% {
        transform: translate(5%, -5%) scale(0.95);
    }
}

/* Global Typography */
.gradient-text {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

body[data-theme="cyberpunk"] .gradient-text {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body[data-theme="minimalist"] .gradient-text {
    background: none;
    -webkit-text-fill-color: initial;
    color: var(--text-primary);
}

h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.success-text {
    color: var(--success-color);
    font-size: 1.2rem;
}

.danger-text {
    color: var(--danger-color);
    font-size: 1.2rem;
}

.divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

/* Layout Structure */
.app-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar as Drawer */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    left: -320px;
    /* Hidden by default off-screen */
    top: 0;
    bottom: 0;
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);

    /* Hardware Acceleration */
    will-change: transform;
    transform: translateZ(0);
}

.sidebar.open {
    transform: translateX(320px);
    /* Slide in */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    cursor: default;
}

.logo-icon {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 8px rgba(139, 92, 246, 0.5));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
}

.side-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem 0.5rem;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    font-family: inherit;

    /* Touch Target */
    min-height: 44px;
}

.nav-btn:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 20px -5px var(--accent-color);
}

.nav-btn.active i {
    color: white;
}

.nav-btn i {
    font-size: 1.2rem;
}

/* Sidebar Footer User Info */
.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details .name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-details .role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
}

.top-bar {
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    background-color: transparent;
    /* Changed from glass-bg to match the global blur */
    z-index: 10;
}

.top-bar-title {
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.content-container {
    flex: 1;
    padding: 2.5rem 3rem;
    overflow-y: auto;
}

/* Views & Animation */
.view {
    display: none;
    width: 100%;
    animation: slideFadeUp 0.4s ease forwards;
    max-width: 1200px;
    margin: 0 auto;
    pointer-events: none;
}

.view.active {
    display: block;
    pointer-events: auto;
}

@keyframes slideFadeUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 2.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin-top: 0.5rem;
}

/* Reusable Cards */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Premium shadow */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    /* Glassmorphism inner glow */
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 4px 6px rgba(0, 0, 0, 0.05);
}

.card-max {
    max-width: 700px;
}

/* Accordions for Cards */
.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.accordion-header h2 {
    margin: 0;
    /* Reset margin from h2 */
}

.accordion-header:hover {
    color: var(--accent-light);
}

.accordion-icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Shop List Interactive Item */
.shop-list-item {
    display: flex;
    align-items: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1rem;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.shop-list-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.shop-list-image {
    width: 80px;
    height: 80px;
    border-radius: 0.75rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shop-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shop-list-info {
    flex: 1;
    overflow: hidden;
}

.shop-list-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.shop-list-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.shop-list-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.shop-list-item:hover .shop-list-arrow {
    opacity: 1;
    transform: translateX(5px);
    color: var(--accent-color);
}

.card.open .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 0;
}

.card.open .accordion-content {
    max-height: 2000px;
    /* Large enough to hold content */
    opacity: 1;
    margin-top: 1.5rem;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

.product-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.product-image {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

body[data-theme="minimalist"] .product-image {
    background: #f5f5f7;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Skeleton Loading Animations */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, var(--skeleton-base) 4%, var(--skeleton-highlight) 25%, var(--skeleton-base) 36%);
    background-size: 1000px 100%;
}

.skeleton-text {
    height: 1.2rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-image {
    width: 100%;
    aspect-ratio: 1;
}

.skeleton-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
}


/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}

.empty-state.hidden {
    display: none;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    opacity: 0.5;
}

/* Forms */
.standard-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.standard-form input[type="text"],
.standard-form input[type="number"],
.standard-form input[type="url"],
.standard-form input[type="tel"],
.styled-select,
.standard-form textarea {
    width: 100%;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.standard-form input:focus,
.styled-select:focus,
.standard-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.file-input {
    padding: 0.6rem !important;
}

.radio-toggle {
    display: flex;
    gap: 1.5rem;
    color: var(--text-primary);
}

.radio-toggle label {
    font-size: 0.95rem;
    cursor: pointer;
}

.radio-toggle input {
    margin-right: 0.4rem;
    cursor: pointer;
}

.submit-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-top: 0.5rem;
    box-shadow: 0 4px 15px rgba(var(--accent-color-rgb, 139, 92, 246), 0.3);
}

.submit-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(var(--accent-color-rgb, 139, 92, 246), 0.5);
}

.submit-btn:active {
    transform: translateY(1px) scale(0.98);
}

/* Action buttons inside forms/tables */
.action-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
    transform: translateY(1px) scale(0.95);
}

/* Themes Grid */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.theme-card {
    background: var(--surface-color);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-card:hover {
    transform: translateY(-4px);
}

/* Photo Upload UI */
.photo-upload-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0.5rem;
}

.photo-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.photo-preview-item {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-photo-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.delete-photo-btn:hover {
    background: #ef4444;
}

.add-photo-btn {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.5rem;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.add-photo-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.add-photo-btn.uploading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.add-photo-btn.uploading::before {
    content: "⏳";
    position: absolute;
    z-index: 3;
    font-size: 1rem;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }

    100% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.theme-card.active {
    border-color: var(--accent-color);
    box-shadow: var(--shadow);
}

.theme-preview {
    height: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-accent {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-info {
    padding: 1.25rem;
}

.theme-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.theme-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Permissions List */
.permissions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.permissions-list li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.permissions-list li i {
    margin-top: 0.1rem;
}

/* Profile View */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 2rem;
}

/* Image Preview in Feedback */
.image-preview-container {
    position: relative;
    max-width: 200px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-top: 1rem;
}

.image-preview-container img {
    width: 100%;
    height: auto;
    display: block;
}

#remove-feedback-image {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.image-preview-container.hidden {
    display: none;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Menu Toggle */
.menu-toggle-btn {
    cursor: pointer;
    color: var(--text-primary);
    margin-right: 1rem;
    display: block;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    position: relative;
    z-index: 1000;
}

.menu-toggle-btn:hover {
    background: var(--surface-hover);
}

@media (max-width: 800px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 80%;
        /* Takes more screen space on mobile */
        left: -100%;
        /* Fully off-screen */
    }

    .sidebar.open {
        transform: translateX(125%);
        /* Adjust slide-in distance */
    }

    .content-container {
        padding: 1.5rem;
    }

    .top-bar-title {
        display: none;
    }
}

/* ==============================================================
   Modal Global Styles
   ============================================================== */
.modal {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay, rgba(0, 0, 0, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-color);
    /* Fallback for contrast */
    padding: 2rem;
    border-radius: 1.5rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal.hidden .modal-content {
    transform: scale(0.95) translateY(20px);
}

/* Glassmorphism exception for modals */
body[data-theme="asg-glass"] .modal-content,
body[data-theme="ocean"] .modal-content {
    background: var(--surface-color);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow);
}

/* Fix visibility for Craft theme */
body[data-theme="asg-craft"] .modal-content {
    background: var(--bg-color);
    /* solid background */
    box-shadow: 0 25px 50px -12px rgba(61, 43, 31, 0.4);
}

/* ==============================================================
   Compact Grid & Product Carousel Modal Styles
   ============================================================== */

.compact-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 1rem !important;
}

.compact-grid .product-info {
    padding: 0.75rem !important;
}

.compact-grid .product-title {
    font-size: 0.95rem !important;
    margin-bottom: 0.25rem !important;
}

.compact-grid .product-price {
    font-size: 1.05rem !important;
}

/* Premium Product Modal */
.product-modal-content {
    background: var(--bg-color) !important;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

body[data-theme="asg-glass"] .product-modal-content,
body[data-theme="ocean"] .product-modal-content {
    background: var(--surface-color) !important;
}

.product-carousel {
    position: relative;
    width: 100%;
    height: 350px;
    background: #000;
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 5;
}

.carousel-indicators .dot {
    transition: width 0.3s ease, background 0.3s ease;
}

.carousel-indicators .dot.active {
    width: 16px !important;
    border-radius: 4px !important;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background: var(--accent-color);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.product-modal-info {
    padding: 1.5rem;
}

.pm-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.pm-qty-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

from {
    opacity: 0;
    transform: scale(0.98);
}

to {
    opacity: 1;
    transform: scale(1);
    background: var(--surface-color);
    padding: 0.8rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.cart-item-price {
    font-size: 0.9rem;
    color: var(--accent-color);
}

.cart-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.3rem;
    border-radius: 20px;
}

.cart-qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-qty-btn:hover {
    background: var(--accent-light);
    color: white;
}

.cart-item-remove {
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    background: #ef4444;
    color: white;
}

/* Floating Cart Button Re-positioned */
.floating-btn {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 140px;
    height: 56px;
    border-radius: 28px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Initial state for hidden elements */
    padding: 0 1.5rem;
}

/* ==============================================================
   Mobile Optimization
   ============================================================== */
@media (max-width: 800px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 80%;
        left: -100%;
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(125%);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .content-container {
        padding: 1.5rem;
    }

    .top-bar-title {
        display: none;
    }

    .compact-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    .content-container {
        padding: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        padding: 1.25rem;
        margin: 1rem;
        width: auto;
        max-height: 88vh;
    }

    .product-modal-content {
        padding: 0 !important;
        overflow: hidden;
    }

    .product-modal-info {
        padding: 1rem;
    }

    .product-carousel {
        height: 250px;
    }

    .radio-toggle {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-btn,
    .action-btn,
    .submit-btn {
        min-height: 48px;
        /* Larger touch targets */
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.15rem;
    }

    .floating-btn {
        bottom: 1rem;
        width: calc(100% - 2rem);
        left: 1rem;
        transform: none;
    }

    .shop-list-item {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .shop-list-image {
        width: 100%;
        height: 140px;
    }

    .shop-list-arrow {
        display: none;
    }

    .table-container {
        width: 100%;
        overflow-x: auto;
    }

    table {
        white-space: nowrap;
    }
}


.floating-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 20px) scale(0.9);
    pointer-events: none;
}

.floating-btn:hover {
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    filter: brightness(1.1);
}

.floating-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.floating-btn i {
    font-size: 1.4rem;
}

#cart-badge {
    position: static;
    background: #ef4444;
    color: white;
    font-size: 0.9rem;
    font-weight: bold;
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    margin-left: 0.5rem;
}

/* Pulsing animation for cart when items exist */
@keyframes pulseCart {
    0% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(139, 92, 246, 0.4);
    }

    70% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 0 15px rgba(139, 92, 246, 0);
    }

    100% {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(139, 92, 246, 0);
    }
}

.floating-btn.has-items {
    animation: pulseCart 2s infinite;
}

/* New Elegant Celestial/Saturn Logo Animations */
.celestial-logo {
    color: var(--accent-light, #a78bfa);
    filter: drop-shadow(0 0 8px var(--accent-color));
    animation: celestialFloat 6s ease-in-out infinite;
    transform-origin: center;
}

.celestial-logo ellipse {
    animation: ringGlow 4s ease-in-out infinite alternate;
}

.orbiting-star {
    transform-origin: 50px 50px;
    animation: orbit 10s linear infinite;
}

.orbiting-star-alt {
    transform-origin: 50px 50px;
    animation: orbitAlt 15s linear infinite;
}

@keyframes celestialFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }

    50% {
        transform: translateY(-3px) rotate(2deg) scale(1.05);
        filter: drop-shadow(0 0 12px var(--accent-color));
    }
}

@keyframes ringGlow {
    from {
        color: rgba(255, 255, 255, 0.4);
    }

    to {
        color: rgba(255, 255, 255, 0.9);
        filter: drop-shadow(0 0 5px white);
    }
}

@keyframes orbit {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes orbitAlt {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0deg);
    }
}

.action-btn {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.list-row:last-child {
    border-bottom: none;
}

/* Enhanced Alert Modal Overlay */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.alert {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    max-width: 90%;
    width: 400px;
}

.alert.success {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), var(--surface-color));
}

.alert.error {
    border-color: rgba(239, 68, 68, 0.4);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), var(--surface-color));
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    font-size: 1.05rem;
    line-height: 1.4;
}

.alert-content i {
    font-size: 1.5rem;
}

.alert.success i {
    color: #10b981;
}

.alert.error i {
    color: #ef4444;
}

.alert.info i {
    color: #3b82f6;
}

.alert-close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.alert-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

@keyframes dropIn {
    0% {
        opacity: 0;
        transform: translateY(-40px) scale(0.9);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}