/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #059669;
    --primary-dark: #047857;
    --emerald-green: #059669;
    --emerald-dark: #047857;
    --emerald-light: #d1fae5;
    --accent-color: #10b981;
    --dark-navy: #0f172a;
    --card-bg: #ffffff;
    --body-bg: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --radius-lg: 16px;
    --radius-md: 12px;
}

/* Primary Color Overrides (Emerald Brand Theme) */
.btn-primary, .bg-primary {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: #047857 !important;
    border-color: #047857 !important;
}

.btn-outline-primary {
    color: #059669 !important;
    border-color: #059669 !important;
}

.btn-outline-primary:hover {
    background-color: #059669 !important;
    color: #ffffff !important;
}

.text-primary {
    color: #059669 !important;
}

.border-primary {
    border-color: #059669 !important;
}

body {
    font-family: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    padding-bottom: 75px; /* For mobile bottom nav space */
    min-height: 100vh;
}

/* Header & Navbar */
.app-header {
    background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #059669 100%);
    color: #ffffff;
    padding: 12px 0;
    box-shadow: 0 4px 15px rgba(4, 120, 87, 0.2);
    position: relative;
    z-index: 1050 !important;
}

.app-header .dropdown {
    position: relative;
    z-index: 1060 !important;
}

.app-header .dropdown-menu {
    z-index: 1070 !important;
    margin-top: 10px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
}

.bg-gradient-emerald {
    background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #059669 100%);
}

.bg-emerald-light {
    background-color: #d1fae5;
}
.text-emerald-dark {
    color: #047857;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff !important;
}

.app-logo-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.app-title-text {
    font-weight: 700;
    font-size: 1.15rem;
    line-height: 1.2;
    margin: 0;
}

.app-subtitle {
    font-size: 0.78rem;
    opacity: 0.85;
    font-weight: 400;
}

/* Sub Navigation Menu Bar (Tier 2) */
.sub-navbar {
    background: #ffffff !important;
    border-bottom: 2px solid #e2e8f0 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    position: sticky;
    top: 0;
    z-index: 1020;
    padding: 6px 0 !important;
}

a.nav-tab-item, a.nav-tab-item:link, a.nav-tab-item:visited {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    color: #334155 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    transition: all 0.2s ease !important;
    margin-right: 6px !important;
    margin-bottom: 2px !important;
    background: transparent !important;
}

a.nav-tab-item i {
    font-size: 1.05rem !important;
    color: #059669 !important;
}

a.nav-tab-item:hover {
    color: #047857 !important;
    background-color: #f0fdf4 !important;
    text-decoration: none !important;
}

a.nav-tab-item.active {
    color: #ffffff !important;
    background-color: #059669 !important;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3) !important;
    text-decoration: none !important;
}

/* Running Marquee Notice Bar */
.notice-ticker-bar {
    background-color: #fef3c7 !important;
    border-bottom: 1px solid #fde68a !important;
}
.notice-ticker-bar marquee a {
    color: #1e293b !important;
    font-weight: 600;
}
.notice-ticker-bar marquee a:hover {
    color: #047857 !important;
    text-decoration: underline !important;
}

/* User Pill Badge */
.user-pill {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 14px;
    border-radius: 30px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.user-pill:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Cards & Widgets */
.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    height: 100%;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}

.stat-icon.emerald { background: #d1fae5; color: #047857; }
.stat-icon.danger { background: #fee2e2; color: #dc2626; }
.stat-icon.warning { background: #fef3c7; color: #d97706; }
.stat-icon.primary { background: #dbeafe; color: #2563eb; }
.stat-icon.purple { background: #f3e8ff; color: #7e22ce; }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-navy);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

/* Quick Action Tiles */
.action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.action-tile:hover {
    background: #f0fdf4;
    border-color: #a7f3d0;
    color: var(--emerald-dark);
    transform: translateY(-2px);
}
.action-tile-icon {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--emerald-green);
}

/* Fraud Alert Badge & Cards */
.fraud-card {
    border-left: 5px solid #ef4444;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}
.fraud-card:hover {
    box-shadow: var(--shadow-md);
}

.risk-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.risk-badge.high { background: #fee2e2; color: #991b1b; }
.risk-badge.medium { background: #fef3c7; color: #92400e; }
.risk-badge.resolved { background: #d1fae5; color: #065f46; }

/* Mobile Bottom Navigation Bar (App-like feel) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.06);
    z-index: 1040;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 6px 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
}

.mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--emerald-dark);
}
.mobile-nav-item.active i {
    transform: scale(1.15);
}

/* Custom Table Styles */
.table-custom {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.table-custom th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 12px 16px;
    font-size: 0.9rem;
    border-bottom: 2px solid #e2e8f0;
}
.table-custom td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}

/* Custom Modal & Buttons */
.btn-emerald {
    background-color: var(--emerald-green);
    color: #ffffff;
    border: none;
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 10px 20px;
    transition: all 0.2s ease;
}
.btn-emerald:hover {
    background-color: var(--emerald-dark);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

.btn-outline-emerald {
    border: 2px solid var(--emerald-green);
    color: var(--emerald-green);
    font-weight: 600;
    border-radius: var(--radius-md);
}
.btn-outline-emerald:hover {
    background-color: var(--emerald-green);
    color: #ffffff;
}

/* Search Box Hero */
.hero-search-box {
    background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
    border-radius: 20px;
    padding: 30px 20px;
    color: #ffffff;
    box-shadow: var(--shadow-lg);
    margin-bottom: 25px;
}

.search-input-lg {
    border-radius: 30px 0 0 30px !important;
    padding: 14px 24px;
    font-size: 1.1rem;
    border: none;
}
.search-btn-lg {
    border-radius: 0 30px 30px 0 !important;
    padding: 14px 28px;
    font-size: 1.1rem;
    font-weight: 600;
    background: #f59e0b;
    color: #000;
    border: none;
}
.search-btn-lg:hover {
    background: #d97706;
    color: #fff;
}

/* Mobile Header & Responsive Adjustments */
.mobile-bottom-nav {
    display: none !important;
}

/* Facebook Reactions & Touch Protection */
.reaction-container,
.reaction-btn,
.reaction-popover,
.reaction-icon {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    touch-action: manipulation;
}

.reaction-popover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15) !important;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(0.7); }
    100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.reaction-icon {
    display: inline-block;
    transition: transform 0.15s ease;
    cursor: pointer;
}

.reaction-icon:hover, .reaction-icon:active {
    transform: scale(1.35) translateY(-4px);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex !important;
    }
    body {
        padding-bottom: 75px;
    }

    .app-header {
        padding: 10px 0;
    }

    .app-brand {
        gap: 8px;
    }

    .app-logo-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
        border-radius: 8px;
    }

    .app-title-text {
        font-size: 0.95rem;
        line-height: 1.2;
        max-width: 210px;
        word-break: break-word;
    }

    .app-subtitle {
        font-size: 0.68rem;
    }

    .user-pill {
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 0.82rem;
    }

    .user-pill span.shop-title-text {
        display: none; /* Hide long text on small mobile screens to prevent header overflow */
    }

    /* Mobile Search Hero Box */
    .hero-search-box {
        padding: 20px 14px;
        border-radius: 16px;
    }

    .hero-search-box h4 {
        font-size: 1.15rem;
    }

    .input-group.max-w-600 {
        flex-direction: column !important;
        gap: 8px;
    }

    .search-input-lg {
        border-radius: 12px !important;
        font-size: 0.95rem;
        padding: 12px 16px;
        width: 100% !important;
        text-align: center;
    }

    .search-btn-lg {
        border-radius: 12px !important;
        width: 100% !important;
        padding: 12px 20px;
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    .user-pill span.shop-title-text {
        display: inline;
    }
}

/* Fix All Dropdown Visibility & Layering */
.dropdown-menu {
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12) !important;
    z-index: 1070 !important;
}

/* Upgraded Receipt & Print Styling */
.receipt-border-container {
    border: 2px solid #059669 !important;
    border-radius: 16px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.paid-watermark-stamp {
    position: absolute;
    right: 25px;
    top: 110px;
    opacity: 0.08;
    font-size: 55px;
    font-weight: 900;
    color: #059669;
    transform: rotate(-18deg);
    pointer-events: none;
    border: 4px solid #059669;
    padding: 2px 20px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    user-select: none;
}

@media print {
    .no-print {
        display: none !important;
    }
}
