/* ssp-mobile-app Main Styles */

:root {
    /* Sophisticated Color Palette - Focused on #029147 */
    --primary: #029147;
    --primary-light: rgba(2, 145, 71, 0.1);
    --secondary: #016b35;
    --accent: #FF9F1C;
    --bg-body: #F4F7F9;
    --card-bg: #FFFFFF;
    --card-border: rgba(0, 0, 0, 0.05);
    --text-main: #1A1C1A;
    --text-muted: #5F6368;
    --white: #FFFFFF;
    --shadow-subtle: 0 8px 24px rgba(0, 0, 0, 0.04);
    --shadow-strong: 0 12px 32px rgba(0, 0, 0, 0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
    --loader-bg: #FFFFFF;
}

body.dark-mode {
    --bg-body: #0B0E0D;
    /* Deeper Dark with Green tint */
    --card-bg: #161B19;
    /* Greenish Dark Card */
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #E6F3EC;
    --text-muted: #8AA394;
    --primary: #029147;
    --primary-light: rgba(2, 145, 71, 0.15);
    --loader-bg: #000000;
}

body {
    background-color: var(--bg-body);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--text-main);
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}

/* Floating Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--primary);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    z-index: 2000;
    box-shadow: var(--shadow-subtle);
    transition: all 0.3s ease;
}

.dark-mode-toggle:active {
    transform: scale(0.9);
}

/* App Container */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

/* Content Views */
.view-content {
    display: none;
    padding: 40px 20px 140px 20px;
    animation: fadeIn 0.5s ease-out;
}

.view-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards Style - Material 3 Inspired */
.m3-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-subtle);
}

.card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    opacity: 0.8;
    margin-bottom: 20px;
    display: block;
}

/* Onboarding - Compact */
.onboarding-header {
    text-align: center;
    margin-bottom: 24px;
}

.onboarding-header img {
    width: 140px;
    height: auto;
    margin-bottom: 4px;
}

.onboarding-header h1 {
    margin-top: 4px !important;
    font-size: 28px !important;
}

.onboarding-header p {
    font-size: 14px !important;
    margin-bottom: 0;
}

.step-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 12px 16px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
}

.step-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    margin-right: 16px;
    flex-shrink: 0;
}

.step-text {
    font-size: 15px;
    font-weight: 500;
}

/* Modern Navigation */
.modern-nav {
    position: fixed;
    bottom: 24px;
    left: 20px;
    right: 20px;
    background: var(--card-bg);
    height: 72px;
    border-radius: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--card-border);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.nav-item.active {
    color: var(--primary);
}

.has-member .nav-item {
    display: flex;
}

/* Fab Scan */
.scan-fab-wrapper {
    width: 80px;
    height: 80px;
    margin-top: -40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.scan-fab {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(45, 106, 79, 0.4);
    border: 5px solid var(--card-bg);
}

.scan-fab:active {
    transform: scale(0.9);
}

.scan-fab i {
    font-size: 24px;
}

.scan-fab span {
    font-size: 9px;
    font-weight: 800;
    margin-top: 2px;
}

/* Detail Items */
.detail-row {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--card-border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-info label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
}

.detail-info span {
    font-size: 17px;
    font-weight: 700;
    display: block;
}

.product-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--primary-light);
}

/* Order Row */
.order-item-android {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.order-qty-pill {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    margin-left: auto;
}

/* Scanner Overlay */
#view-scan-camera {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 3000;
    display: none;
}

.scanner-top-bar {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 10;
}

.btn-cam-cancel {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.scanner-overlay-android {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    pointer-events: none;
}

.scanner-box {
    width: 260px;
    height: 260px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    position: relative;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.6);
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    box-shadow: 0 0 15px var(--primary);
    animation: scanLine 2s linear infinite;
    border-radius: 2px;
}

/* Clear Library Defaults to only show video */
#reader {
    border: none !important;
}

#reader * {
    border: none !important;
}

#reader img {
    display: none !important;
}

#reader__dashboard {
    display: none !important;
}

#reader__status_span {
    display: none !important;
}

#reader__scan_region {
    border: none !important;
}

#reader__scan_region div {
    border: none !important;
    background: transparent !important;
}

#reader video {
    border-radius: 0 !important;
}

@keyframes scanLine {
    0% {
        top: 0;
    }

    50% {
        top: 100%;
    }

    100% {
        top: 0;
    }
}

.scanner-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--primary);
    border-style: solid;
    z-index: 10;
}

.tl {
    top: -5px;
    left: -5px;
    border-width: 5px 0 0 5px;
    border-top-left-radius: 16px;
}

.tr {
    top: -5px;
    right: -5px;
    border-width: 5px 5px 0 0;
    border-top-right-radius: 16px;
}

.bl {
    bottom: -5px;
    left: -5px;
    border-width: 0 0 5px 5px;
    border-bottom-left-radius: 16px;
}

.br {
    bottom: -5px;
    right: -5px;
    border-width: 0 5px 5px 0;
    border-bottom-right-radius: 16px;
}

/* Global Loader */
#global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--loader-bg);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

#global-loader img {
    width: 100px;
}

/* Profile View Specifics */
.banner-img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    cursor: pointer;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.logo-container {
    position: absolute;
    bottom: -32px;
    left: 24px;
    z-index: 10;
}

.logo-img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    border: 4px solid var(--card-bg);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    background: white;
}

.profile-title-section {
    padding: 48px 8px 16px 8px;
}

.profile-title-section h1 {
    font-size: 32px;
    margin: 0;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

.shop-address-line {
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.shop-address-line i {
    margin-right: 10px;
    color: var(--primary);
    font-size: 16px;
}

.contact-section {
    display: flex;
    align-items: center;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
    cursor: pointer;
}

.contact-info {
    margin-left: 20px;
}

.contact-info h4 {
    margin: 0;
    font-size: 20px;
}

.wa-link {
    margin: 2px 0 0 0;
    color: #25d366;
    font-weight: 700;
    font-size: 17px;
}

/* Scanner Overlays */
.scanner-instruction {
    position: absolute;
    bottom: 80px;
    color: white;
    font-weight: 600;
    font-size: 15px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 24px;
    border-radius: 20px;
}

/* Modal Helpers */
.touch-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 5000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    touch-action: none;
}

.modal-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 5001;
}

#previewTitle {
    color: white;
    font-weight: 700;
}

#previewWrap {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#previewImage {
    max-width: 100%;
    max-height: 100%;
    transform-origin: center;
    transition: transform 0.1s ease-out;
    cursor: move;
}

/* Upload QR Image Section */
.upload-qr-section {
    position: absolute;
    bottom: 32px;
    left: 24px;
    pointer-events: auto;
}

.btn-upload-qr {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.btn-upload-qr:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.25);
}

.btn-upload-qr i {
    font-size: 22px;
}