/* ========================================
   Super Sale POS - Complete Stylesheet
   Fixed: Better contrast, readable text, scroll fix
   ======================================== */

:root {
    --primary-gold: #C9A03D;
    --primary-gold-dark: #8B6914;
    --primary-gold-light: #E6C265;
    --navy-dark: #0A1628;
    --navy-light: #132A4A;
    --navy-card: #0D1F3A;
    --text-white: #FFFFFF;
    --text-light: #F0F0F0;
    --text-muted: #CCCCCC;
    --text-dark: #0A1628;
    --success-color: #2DBA4E;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --sidebar-width: 260px;
    /* ADDED: Status bar height variable */
    --status-bar-height: env(safe-area-inset-top, 0px);
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-white);
    background-color: var(--navy-dark);
    overflow-x: hidden;
    height: 100vh;
}

/* ===== TYPOGRAPHY - ALL TEXT WHITE ===== */
body, p, span, div, li, td, th, label, .text-muted, small, .card-text, .info-box p, .features-list li, .about-page .info-box p {
    color: var(--text-light) !important;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--primary-gold) !important;
    margin-bottom: 0.75rem;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary-gold) !important;
}

/* ===== SIDEBAR - FIXED SCROLL ===== */
.sidebar {
    min-height: 100vh;
    height: 100vh;
    background: linear-gradient(180deg, #0A1628 0%, #0D1F3A 100%);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 1000;
    transition: transform 0.3s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-inner {
    padding-bottom: 30px;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 5px;
}

.sidebar .nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    padding: 0.9rem 1.2rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .nav-link:hover {
    color: var(--primary-gold-light) !important;
    background: rgba(201, 160, 61, 0.12);
    border-left-color: var(--primary-gold);
}

.sidebar .nav-link.active {
    color: var(--primary-gold) !important;
    background: rgba(201, 160, 61, 0.15);
    border-left-color: var(--primary-gold);
    font-weight: 600;
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    width: 1.6rem;
}

/* Shop Badge */
/* 3D Gradient Animated Badge */
.shop-badge-gradient-3d {
    background: linear-gradient(135deg, #C9A03D, #D4AF37, #8B6914, #C9A03D);
    background-size: 300% 300%;
    color: #0A1628 !important;
    padding: 1.2rem 1rem;
    margin: 1rem;
    border-radius: 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: gradientMove 4s ease infinite;
    word-break: break-word;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.shop-badge-gradient-3d:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== MAIN CONTENT ===== */
main {
    margin-left: var(--sidebar-width);
    padding: 1.2rem;
    min-height: 100vh;
    background-color: #071224;
    transition: margin-left 0.3s;
    overflow-y: auto;
    height: 100vh;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    margin-bottom: 1.2rem;
    background: linear-gradient(135deg, #0D1F3A 0%, #0A1628 100%);
    border: 1px solid rgba(201, 160, 61, 0.2);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #C9A03D 0%, #8B6914 100%);
    padding: 0.9rem 1.2rem;
    font-weight: 700;
    color: #0A1628 !important;
    border-bottom: none;
}

.card-header h5, .card-header h6 {
    color: #0A1628 !important;
    margin: 0;
}

.card-body {
    padding: 1.2rem;
}

.card-title {
    color: var(--primary-gold) !important;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

/* ===== TABLES ===== */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
}

.table {
    width: 100%;
    margin-bottom: 0;
    color: var(--text-light) !important;
}

.table thead th {
    background: linear-gradient(135deg, #C9A03D 0%, #8B6914 100%);
    color: #0A1628 !important;
    font-weight: 700;
    padding: 0.9rem 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.table tbody td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-light) !important;
    background: transparent;
}

.table tbody tr:hover {
    background: rgba(201, 160, 61, 0.08);
}

/* ===== CALENDAR STYLES - WHITE TEXT ===== */
.calendar-day {
    color: var(--text-light) !important;
}

.calendar-day .day-number {
    color: var(--text-light) !important;
}

.calendar-weekday {
    color: var(--primary-gold) !important;
}

.holiday-name, .holiday-date {
    color: var(--text-light) !important;
}

/* ===== ABOUT PAGE - WHITE TEXT ===== */
.about-page .info-box p,
.about-page .features-list li,
.about-page .info-box h6,
.about-page p,
.about-page .card-text {
    color: var(--text-light) !important;
}

.about-page .features-list h6 {
    color: var(--primary-gold) !important;
}

/* ===== NOTIFICATION ICON - FIXED ===== */
.notification-icon-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #e74a3b;
    color: white !important;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    text-align: center;
}

.notification-icon {
    cursor: pointer;
    font-size: 1.3rem;
    padding: 8px;
    border-radius: 50%;
    color: var(--primary-gold);
    transition: all 0.2s;
}

.notification-icon:hover {
    background: rgba(201, 160, 61, 0.2);
    transform: scale(1.05);
}

/* Notification Image Styles - Consistent Size */
.notification-image {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    background-color: #0D1F3A;
}

.notification-image-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #C9A03D 0%, #8B6914 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-image-placeholder i {
    font-size: 24px;
    color: #0A1628;
}

/* Notification item styling */
.notification-item {
    transition: all 0.2s;
    border-left: 3px solid transparent;
    background: rgba(13, 31, 58, 0.9);
    border-radius: 12px;
    margin-bottom: 0.6rem;
    padding: 1rem !important;
}

.notification-item:hover {
    background: rgba(201, 160, 61, 0.1);
    transform: translateX(3px);
}

.notification-item.active {
    border-left-color: #C9A03D;
    background: rgba(201, 160, 61, 0.08);
}

.notification-item h6 {
    color: #C9A03D !important;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.notification-item p {
    color: #E8E8E8 !important;
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Notification scrollable area */
.notification-scrollable {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Modal body padding fix */
#notificationModal .modal-body {
    padding: 0;
}

/* ===== BUSINESS TYPE CARDS - FIXED CLICK ===== */
.business-type-card {
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid rgba(201, 160, 61, 0.3);
    background: linear-gradient(135deg, #12203F 0%, #0A1628 100%);
    border-radius: 1rem;
}

.business-type-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(201, 160, 61, 0.2);
}

.business-type-card.selected {
    border-color: #C9A03D;
    background: rgba(201, 160, 61, 0.15);
}

.business-type-card .card-body h6,
.business-type-card .card-body small,
.business-type-card .card-body i {
    color: var(--text-light) !important;
}

.business-type-card.selected .card-body h6 {
    color: var(--primary-gold) !important;
}

/* ===== FORMS ===== */
.form-label {
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    color: var(--primary-gold) !important;
}

.form-control, .form-select {
    border: 1px solid rgba(201, 160, 61, 0.35);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    background: rgba(13, 31, 58, 0.9);
    color: var(--text-white) !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 3px rgba(201, 160, 61, 0.25);
    background: #0D1F3A;
    color: var(--text-white) !important;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ===== BUTTONS ===== */
.btn {
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #C9A03D 0%, #8B6914 100%);
    border: none;
    color: #0A1628 !important;
    font-weight: 700;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #C9A03D 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 160, 61, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, #2DBA4E 0%, #1a8a3a 100%);
    border: none;
    color: white !important;
}

.btn-danger {
    background: linear-gradient(135deg, #e74a3b 0%, #c0392b 100%);
    border: none;
    color: white !important;
}

.btn-warning {
    background: linear-gradient(135deg, #f6c23e 0%, #dda20a 100%);
    border: none;
    color: #0A1628 !important;
    font-weight: 600;
}

/* ===== BADGES ===== */
.badge {
    font-weight: 600;
    padding: 0.35rem 0.8rem;
    font-size: 0.7rem;
    border-radius: 30px;
}

.badge.bg-success {
    background: #2DBA4E !important;
    color: white !important;
}

.badge.bg-warning {
    background: #f6c23e !important;
    color: #0A1628 !important;
}

.badge.bg-danger {
    background: #e74a3b !important;
    color: white !important;
}

.badge.bg-info {
    background: #36b9cc !important;
    color: #0A1628 !important;
}

/* ===== MODAL ===== */
.modal-content {
    border-radius: 20px;
    background: linear-gradient(135deg, #0D1F3A 0%, #0A1628 100%);
    border: 1px solid rgba(201, 160, 61, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, #C9A03D 0%, #8B6914 100%);
    border-radius: 20px 20px 0 0;
    padding: 1.2rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 700;
    color: #0A1628 !important;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-light);
}

/* ===== MOBILE MENU ===== */
@media (max-width: 991px) {
    /* ONLY UPDATED: Menu Toggle Button with status bar padding */
    #menuToggle {
        display: block;
        position: fixed;
        top: calc(12px + var(--status-bar-height, 0px));
        left: 12px;
        z-index: 1100;
        background: linear-gradient(135deg, #C9A03D 0%, #8B6914 100%);
        border: none;
        border-radius: 10px;
        padding: 8px 12px;
    }
    
    /* RESTORED: Sidebar back to original - NO padding */
    #sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1099;
        height: 100vh;
        overflow-y: auto;
    }
    
    #sidebar.show {
        transform: translateX(0);
    }
    
    /* RESTORED: Main content back to original - NO padding change */
    main {
        margin-left: 0;
        padding-top: 60px;
        height: auto;
        min-height: 100vh;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 1098;
        display: none;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* ADDED: iOS specific safe area handling for menu button only */
@supports (padding: max(0px)) {
    #menuToggle {
        top: max(12px, env(safe-area-inset-top));
        left: max(12px, env(safe-area-inset-left));
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .no-print, .sidebar, #menuToggle, .btn-toolbar, .btn-group, .notification-icon-wrapper {
        display: none !important;
    }
    
    main {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-gold);
    border-radius: 3px;
}

/* ===== STAT CARDS ===== */
.stat-card {
    background: linear-gradient(135deg, #0D1F3A 0%, #0A1628 100%);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(201, 160, 61, 0.2);
}

.stat-card h3 {
    color: var(--primary-gold) !important;
    margin: 0.5rem 0;
}

.stat-card p {
    color: var(--text-muted) !important;
    margin: 0;
}

/* ===== INFO BOX ===== */
.info-box {
    background: linear-gradient(135deg, #0D1F3A 0%, #0A1628 100%);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(201, 160, 61, 0.2);
}

.info-box h6 {
    color: var(--primary-gold) !important;
    margin: 0.5rem 0;
}

/* ===== LEGAL CARDS ===== */
.legal-card {
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #0D1F3A 0%, #0A1628 100%);
    border: 1px solid rgba(201, 160, 61, 0.2);
    border-radius: 12px;
}

.legal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(201, 160, 61, 0.15);
    border-color: var(--primary-gold);
}

.legal-card h6 {
    color: var(--primary-gold) !important;
}

.legal-card small {
    color: var(--text-muted) !important;
}

/* New Add Code */
/* ===== UNIVERSAL TABLE FOOTER BLACK TEXT ===== */

/* Every single table footer - no exceptions */
tfoot,
tfoot *,
.table tfoot,
.table tfoot *,
table tfoot,
table tfoot *,
tfoot td,
tfoot th,
.table-secondary,
.table-secondary * {
    color: #0A1628 !important;
    background-color: #e9ecef !important;
}

/* Keep cart total as gold (exception) */
.discount-section #total,
.cart-total,
#total:not(tfoot #total) {
    color: #C9A03D !important;
    background: transparent !important;
}

/* Keep alert info text black */
.alert-info,
.alert-info * {
    color: #0A1628 !important;
}

/* Keep muted text as is */
.text-muted,
small.text-muted {
    color: #AAAAAA !important;
}

/* Simple global fix for all outline buttons */
.btn-outline-primary,
.btn-outline-secondary {
    --bs-btn-hover-bg: #C9A03D !important;
    --bs-btn-hover-border-color: #C9A03D !important;
    --bs-btn-hover-color: #0A1628 !important;
    --bs-btn-active-bg: #C9A03D !important;
    --bs-btn-active-border-color: #C9A03D !important;
    --bs-btn-focus-shadow-rgb: 201, 160, 61 !important;
}

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