/* -------------------------------------------------------------
 * Modern Glassmorphic Dark UI Theme for Zoho to Shopify Engine
 * ------------------------------------------------------------- */

:root {
    --bg-dark: #090d16;
    --card-bg: rgba(22, 30, 46, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --sidebar-width: 260px;
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 10% 10%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 90%, rgba(16, 185, 129, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Layout Architecture */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.brand-logo {
    padding: 24px 20px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--card-border);
}

.brand-logo span {
    color: var(--primary);
}

.nav-menu {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-item a:hover, .nav-item.active a {
    background: rgba(99, 102, 241, 0.15);
    color: #fff;
}

.user-profile-badge {
    padding: 16px;
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-header {
    height: 70px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.content-body {
    padding: 32px;
    flex: 1;
}

/* UI Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
}

.stat-title {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.custom-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--card-border);
}

.custom-table td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.badge-active, .badge-success, .badge-info { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-danger, .badge-error { background: rgba(239, 68, 68, 0.15); color: #f87171; }

/* Buttons & Inputs */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: rgba(255, 255, 255, 0.1); color: #fff; }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.18); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: 12px; }

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: #131b2e;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    padding: 28px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #1e293b;
    border: 1px solid var(--card-border);
    color: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    font-size: 14px;
    min-width: 280px;
}

/* Mobile Toggle & Sidebar Overlay */
.mobile-toggle-btn {
    display: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.mobile-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* -------------------------------------------------------------
 * Responsive Media Queries for Tablets & Mobile Devices
 * ------------------------------------------------------------- */

@media (max-width: 991px) {
    .mobile-toggle-btn {
        display: flex;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .top-header {
        padding: 0 16px;
        height: 64px;
    }

    .page-title {
        font-size: 17px;
    }

    .content-body {
        padding: 20px 16px;
    }

    .card {
        padding: 18px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    .page-title {
        font-size: 16px;
    }

    .card-title {
        font-size: 15px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-card {
        padding: 16px 20px;
    }

    .stat-title {
        font-size: 12px;
    }

    .stat-value {
        font-size: 22px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn {
        font-size: 13px;
        padding: 8px 14px;
    }

    .btn-sm {
        font-size: 11px;
        padding: 4px 10px;
    }

    .form-control {
        font-size: 13px;
        padding: 10px 14px;
    }

    .form-label {
        font-size: 12px;
    }

    .badge {
        font-size: 11px;
        padding: 3px 8px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .custom-table th {
        padding: 10px 12px;
        font-size: 11px;
    }

    .custom-table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    #toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        min-width: auto;
    }

    .toast {
        min-width: auto;
        width: 100%;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 12px;
    }

    .top-header {
        padding: 0 12px;
    }

    .page-title {
        font-size: 14px;
    }

    .card-title {
        font-size: 13px;
    }

    .stat-value {
        font-size: 18px;
    }

    .header-actions {
        gap: 8px;
    }

    .btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 10px;
    }

    .badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .content-body {
        padding: 12px 8px;
    }

    .card {
        padding: 12px;
        border-radius: 12px;
    }

    /* Floating Sync Banner Mobile Adaptation */
    #zoho-sync-banner {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        font-size: 11px !important;
        padding: 8px 12px !important;
        max-width: calc(100vw - 20px) !important;
    }
}

/* Group Accordion Responsive Styling */
.group-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}

.group-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.group-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.group-title-content {
    min-width: 0;
    flex: 1;
}

.group-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.group-title-text {
    font-weight: 700;
    color: #fff;
    font-size: 16px;
    line-height: 1.3;
}

.group-vendor-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-weight: 500;
    border-radius: 6px;
    flex-shrink: 0;
}

.group-id-info {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.group-id-code {
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 11px;
    white-space: nowrap;
}

.group-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.variant-badge {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    white-space: nowrap;
}

@media (max-width: 768px) {
    .group-header {
        padding: 14px 16px;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .group-header {
        padding: 12px 14px;
        gap: 8px;
    }

    .group-icon {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .group-title-text {
        font-size: 14px;
    }

    .group-id-info {
        font-size: 11px;
    }

    .variant-badge {
        font-size: 11px;
        padding: 4px 8px;
    }
}


