/* 
    STAR SYSTEMS CLIENT PORTAL STYLESHEET
    Aesthetic: Premium Light Mode & Soft Shadow Glassmorphism
*/

:root {
    --portal-bg: #f3f4f6;
    --portal-card-bg: rgba(255, 255, 255, 0.85);
    --portal-border: rgba(0, 0, 0, 0.08);
    --portal-border-hover: rgba(186, 204, 40, 0.6);
    --portal-lime: #7a8a18; /* Darker green for contrast in light mode */
    --portal-lime-rgb: 122, 138, 24;
    --portal-cyan: #007791; /* Darker cyan for contrast in light mode */
    --portal-cyan-rgb: 0, 119, 145;
    --portal-text-light: #1e293b; /* Dark text for light mode */
    --portal-text-muted: #64748b;
    --portal-navy: #1B374D;
    
    --success-glow: rgba(56, 161, 105, 0.1);
    --warning-glow: rgba(221, 107, 32, 0.1);
    --danger-glow: rgba(229, 62, 62, 0.1);
}

/* Global Light Base & Enable Scrolling */
body.ss-circuit-overlay {
    background-color: var(--portal-bg) !important;
    color: var(--portal-text-light) !important;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin-bottom: 90px;
    background-image: radial-gradient(circle at 10% 20%, rgba(243, 244, 246, 0.8) 0%, rgba(229, 231, 235, 0.9) 90%) !important;
    overflow: visible !important; /* CRITICAL FIX: Restores scrolling functionality */
    overflow-y: auto !important; /* CRITICAL FIX: Restores vertical scrollbar */
}

/* Disable body scrolling when any Bootstrap modal is active */
body.modal-open {
    overflow: hidden !important;
}

/* Layout Wrapper for Dashboard */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    margin-top: 30px;
    min-height: calc(100vh - 240px);
}

.dashboard-layout > main {
    min-width: 0;
}

@media (max-width: 991px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Card Component - Light Edition */
.glass-card {
    background: var(--portal-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 25px rgba(31, 41, 55, 0.04), 0 2px 4px rgba(31, 41, 55, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--portal-border-hover);
    transform: translateY(-3px);
    box-shadow: 0 16px 35px rgba(27, 55, 77, 0.08);
}

/* Metric / Highlight Widget */
.metric-card {
    border-left: 4px solid var(--portal-lime);
}

.metric-card.cyan {
    border-left: 4px solid var(--portal-cyan);
}

.metric-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 8px 0;
    color: var(--portal-text-light);
}

/* Sidebar Navigation */
.portal-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: var(--portal-text-muted) !important;
    text-decoration: none !important;
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.sidebar-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--portal-text-light) !important;
    border-color: rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(122, 138, 24, 0.08), rgba(122, 138, 24, 0.02));
    border-color: var(--portal-lime);
    color: var(--portal-lime) !important;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(122, 138, 24, 0.06);
}

/* Header & Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--portal-text-light);
}

.text-gray {
    color: var(--portal-text-muted);
}

.text-accent {
    color: var(--portal-lime);
}

.text-cyan {
    color: var(--portal-cyan);
}

/* Tables Styling */
.table-glass {
    width: 100%;
    color: var(--portal-text-light);
    border-collapse: collapse;
}

.table-glass th {
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 2px solid var(--portal-border);
    padding: 16px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--portal-text-muted);
}

.table-glass td {
    padding: 16px;
    border-bottom: 1px solid var(--portal-border);
    vertical-align: middle;
    font-size: 0.9rem;
}

.table-glass tr:hover td {
    background: rgba(0, 0, 0, 0.01);
}

/* Custom Status Badges */
.badge-portal {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
}

.badge-portal.active, .badge-portal.paid, .badge-portal.approved {
    background: rgba(56, 161, 105, 0.1);
    color: #2f855a;
    border-color: rgba(56, 161, 105, 0.2);
}

.badge-portal.pending, .badge-portal.authorised, .badge-portal.submitted {
    background: rgba(221, 107, 32, 0.1);
    color: #c05621;
    border-color: rgba(221, 107, 32, 0.2);
}

.badge-portal.suspended, .badge-portal.unpaid, .badge-portal.rejected {
    background: rgba(229, 62, 62, 0.1);
    color: #c53030;
    border-color: rgba(229, 62, 62, 0.2);
}

/* Premium Form Styles */
.form-glass {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group-glass {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-glass label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--portal-text-muted);
}

.form-control-glass {
    background: #ffffff !important;
    border: 1px solid var(--portal-border) !important;
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--portal-text-light) !important;
    outline: none;
    transition: all 0.25s ease;
}

.form-control-glass:focus {
    border-color: var(--portal-lime) !important;
    box-shadow: 0 0 0 3px rgba(122, 138, 24, 0.15) !important;
}

.form-control-glass:disabled, .form-control-glass[readonly] {
    opacity: 0.8;
    background: #f8fafc !important;
    border-color: rgba(0, 0, 0, 0.05) !important;
}

/* Profiles Form view-mode styling (for Issue #2 read-only state) */
form.view-mode .form-control-glass:not(.readonly-always) {
    border-color: transparent !important;
    background: transparent !important;
    padding-left: 0;
    padding-right: 0;
    font-weight: 500;
    box-shadow: none !important;
    pointer-events: none;
}

/* Button UI */
.btn-portal-primary {
    background: linear-gradient(135deg, #BACC28, #9ab315);
    color: #1e293b;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(186, 204, 40, 0.15);
}

.btn-portal-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(186, 204, 40, 0.25);
    color: #1e293b;
}

.btn-portal-secondary {
    background: #ffffff;
    color: var(--portal-text-light);
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.25s ease;
}

.btn-portal-secondary:hover {
    background: rgba(0, 0, 0, 0.02);
    color: #000000;
}

/* Template JSON Textarea / Expandable */
.template-code-box {
    background: #f8fafc;
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    padding: 16px;
    font-family: 'Consolas', 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    color: var(--portal-cyan);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

/* Glowing Notification Dot */
.glow-dot {
    width: 8px;
    height: 8px;
    background-color: var(--portal-lime);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px var(--portal-lime);
}

.glow-dot.cyan {
    background-color: var(--portal-cyan);
    box-shadow: 0 0 8px var(--portal-cyan);
}

/* Premium Tab Navigation */
.ss-nav-tabs {
    border-bottom: 2px solid var(--portal-border) !important;
    gap: 8px;
}

.ss-nav-tabs .nav-link {
    color: var(--portal-text-muted) !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    padding: 12px 20px !important;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    transition: all 0.25s ease;
    border-radius: 0 !important;
}

.ss-nav-tabs .nav-link:hover {
    color: var(--portal-text-light) !important;
    border-bottom-color: rgba(122, 138, 24, 0.3) !important;
}

.ss-nav-tabs .nav-link.active {
    color: var(--portal-lime) !important;
    border-bottom-color: var(--portal-lime) !important;
    font-weight: 700;
}

/* Phone Mockup Styling */
.phone-mockup {
    width: 320px;
    height: 560px;
    background: #000000;
    border-radius: 36px;
    border: 10px solid #1e293b;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Phone Notch */
.phone-notch {
    width: 120px;
    height: 16px;
    background: #1e293b;
    border-radius: 0 0 14px 14px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

/* Phone Screen */
.phone-screen {
    width: 100%;
    height: 100%;
    background: #efeae2;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
}

/* WhatsApp Phone Header */
.whatsapp-phone-header {
    background: #008069;
    padding: 24px 12px 10px 12px; /* Top padding extra to clear notch */
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.whatsapp-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #128c7e;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.phone-chat-name {
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.phone-chat-status {
    font-size: 0.65rem;
    opacity: 0.8;
    display: block;
    margin-top: -2px;
}

/* WhatsApp Chat Background & Grid */
.whatsapp-chat-bg {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    background-color: #efeae2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23e5ddd5' fill-opacity='0.6'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm1-61c3.16 0 5.72-2.56 5.72-5.72 0-3.16-2.56-5.72-5.72-5.72-3.16 0-5.72 2.56-5.72 5.72 0 3.16 2.56 5.72 5.72 5.72zm37 19c2.2 0 4-1.8 4-4s-1.8-4-4-4-4 1.8-4 4 1.8 4 4 4z'/%3E%3C/g%3E%3C/svg%3E");
    position: relative;
}

.whatsapp-chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-bottom: 20px;
}

.whatsapp-bubble-wrapper {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
    max-width: 95%;
    position: relative;
}

/* WhatsApp Bubble with dynamic tail */
.whatsapp-bubble {
    background: #ffffff;
    padding: 8px 12px 14px 12px;
    border-radius: 0 10px 10px 10px;
    position: relative;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
    color: #111b21;
}

.whatsapp-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 8px;
    height: 10px;
    background: linear-gradient(135deg, #ffffff 50%, transparent 50%);
}

.whatsapp-bubble-header {
    color: var(--portal-cyan);
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.whatsapp-bubble-body {
    font-size: 0.82rem;
    line-height: 1.4;
    word-break: break-word;
}

.whatsapp-bubble-footer {
    font-size: 0.72rem;
    color: #667781 !important;
    margin-top: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 4px;
}

.whatsapp-bubble-timestamp {
    position: absolute;
    right: 8px;
    bottom: 2px;
    font-size: 0.65rem;
    color: #667781;
}

/* WhatsApp Buttons Mockup style */
.whatsapp-bubble-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.whatsapp-btn {
    background: #ffffff;
    color: #008069;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* WhatsApp Input box mockup */
.whatsapp-input-mockup {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
}

.whatsapp-input-field {
    background: #ffffff;
    flex-grow: 1;
    border-radius: 20px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    color: #667781;
}

.whatsapp-voice-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #00A884;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Syncfusion UI Custom Overrides to match Glassmorphism theme
   ========================================================================== */
.e-control, .e-grid, .e-richtexteditor, .e-chart, .e-accumulationchart {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
}

/* Grid overrides */
.e-grid {
    background: var(--portal-card-bg) !important;
    border: 1px solid var(--portal-border) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(31, 41, 55, 0.02) !important;
}

.e-grid .e-gridheader {
    background-color: rgba(0, 0, 0, 0.02) !important;
    border-bottom: 2px solid var(--portal-border) !important;
}

.e-grid .e-headercell {
    background-color: transparent !important;
    color: var(--portal-text-muted) !important;
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.5px !important;
    padding: 14px 16px !important;
}

.e-grid .e-rowcell {
    color: var(--portal-text-light) !important;
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
}

.e-grid .e-row:hover td {
    background-color: rgba(0, 0, 0, 0.02) !important;
}

.e-grid, .e-grid .e-gridheader, .e-grid .e-content, .e-grid td, .e-grid th, .e-grid .e-gridpager {
    border-color: var(--portal-border) !important;
}

.e-grid .e-gridpager {
    background-color: rgba(0, 0, 0, 0.01) !important;
    padding: 12px !important;
}

.e-grid .e-pager .e-numericitem.e-currentitem {
    background-color: var(--portal-lime) !important;
    color: #1e293b !important;
    border-color: var(--portal-lime) !important;
    font-weight: 600 !important;
}

.e-grid .e-pager .e-numericitem:hover {
    background-color: rgba(122, 138, 24, 0.1) !important;
    color: var(--portal-lime) !important;
}

/* Toolbar overrides */
.e-grid .e-toolbar {
    background: rgba(255, 255, 255, 0.5) !important;
    border-bottom: 1px solid var(--portal-border) !important;
    padding: 8px !important;
}

.e-grid .e-toolbar .e-toolbar-items {
    background: transparent !important;
}

.e-grid .e-toolbar .e-input-group {
    background: #ffffff !important;
    border-radius: 8px !important;
    border: 1px solid var(--portal-border) !important;
    box-shadow: none !important;
}

.e-grid .e-toolbar .e-input-group:focus-within {
    border-color: var(--portal-lime) !important;
}

/* Rich Text Editor overrides */
.e-richtexteditor {
    border-radius: 12px !important;
    overflow: hidden !important;
    border-color: var(--portal-border) !important;
    background: #ffffff !important;
}

.e-richtexteditor .e-rte-toolbar {
    background: rgba(0, 0, 0, 0.02) !important;
    border-bottom-color: var(--portal-border) !important;
}

.e-richtexteditor .e-rte-content {
    background: #ffffff !important;
    color: var(--portal-text-light) !important;
    font-size: 0.95rem !important;
}

/* Custom badge integration in grid cells */
.e-grid .badge-portal {
    margin: 0 !important;
    padding: 4px 10px !important;
}

/* Chart Title Styling */
.e-chart-title {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    fill: var(--portal-text-light) !important;
}

