/* ============================================
   Reset & Base Styles
   ============================================ */

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

html, body, :host {
    overscroll-behavior-y: contain;
    touch-action: pan-x pan-y;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-image: url('mountain-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    color: #333;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
}

#verity-root {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Offline Font Definitions
   ============================================ */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 100 700;
  src: url('./assets/fonts/MaterialSymbolsRounded.woff2') format('woff2');
  font-display: block; 
}

.material-symbols-rounded {
  font-family: 'Material Symbols Rounded', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
   Screen Layout
   ============================================ */

.screen {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex !important;
    opacity: 1;
}

/* Staggered Title State */
.title {
    transition: all 0.4s ease;
    transform-origin: left center;
}

/* Staggered effect for Business Mode */
.title.staggered {
    transform: scale(0.6) translateY(-5px);
    opacity: 0.5;
    margin-bottom: -15px; /* Pulls the Business Card up closer */
    filter: blur(0.5px);   /* Optional: gives it a "backgrounded" feel */
}

/* ============================================
   Layout Gap Fixes
   ============================================ */

/* 1. Make the dashboard main container a Flex Column */
main.dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px; /* This controls the gap between Quick Links and Workspace */
}

/* 2. Remove bottom margins from individual containers */
/* This allows the parent 'gap' to control spacing exclusively */
.widgets-container {
    margin-bottom: 0 !important;
}

/* 3. Ensure hidden elements take up ZERO space */
.user-section[style*="display: none"] {
    margin: 0 !important;
    padding: 0 !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Auth / Login Card Styles
   ============================================ */

.setup-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    width: 100%;
    max-width: 500px; /* Keeps the login card from getting too wide */
}

.setup-card h1 {
    font-size: 1.8em;
    color: #1e293b;
    margin: 20px 0 20px 0;
    font-weight: 800;
}

.setup-card a {
    font-weight: 700;
}

/* ============================================
   Setup Screen
   ============================================ */

#setupScreen, #userDetailsScreen {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.setup-container, .details-container {
    width: 100%;
    max-width: 600px;
}

.details-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* ============================================
   Section Information Forms (FIXED ALIGNMENT)
   ============================================ */
.user-detail-input-group {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    text-align: left;
}

.user-detail-input-group h3 {
    margin-bottom: 15px;
    color: #1e293b;
    font-size: 1.1rem;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* ============================================
   User Details Screen - Clean Modern Pro
   ============================================ */

#userDetailsScreen {
    min-height: 100vh;
    display: none; /* Controlled by .active class */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.details-container {
    width: 100%;
    max-width: 500px;
}

.details-card {
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.details-card h1 {
    font-size: 2em;
    color: #1e293b;
    margin-bottom: 8px;
    font-weight: 800;
}

.details-card .subtitle {
    color: #64748b;
    font-size: 1em;
    margin-bottom: 30px;
}

/* ============================================
   The Form & Inputs
   ============================================ */

.user-details-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0px;
}

/* This is the container for the inputs your JS creates */
.user-row {
    background: #f8fafc;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.user-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.user-row input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1rem;
    color: #1e293b;
    background-color: white;
    transition: all 0.2s ease;
}

/* The "Nicer" Interaction */
.user-row input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

/* ============================================
   Buttons
   ============================================ */

.details-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.details-actions button {
    height: 48px !important;  /* Force equal height */
    line-height: 1;           /* Center text vertically */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    margin: 0;
}

/* ============================================
   Settings Action Card (Manage Sections)
   ============================================ */

.settings-action-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 15px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px; /* Space it out from the toggles */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border-left: 4px solid #005EB8; /* Brand accent */
}

.settings-action-card:hover {
    border-color: #005EB8;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 94, 184, 0.15);
}

.settings-action-card .icon-box {
    width: 38px;
    height: 38px;
    background: #e0f2fe; /* Light Blue */
    color: #005EB8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.settings-action-card .text-content {
    flex-grow: 1;
    text-align: left;
}

.settings-action-card .text-content h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.settings-action-card .text-content p {
    margin: 2px 0 0 0;
    font-size: 0.75rem;
    color: #64748b;
}

.settings-action-card .arrow {
    color: #cbd5e1;
    transition: color 0.2s;
}

.settings-action-card:hover .arrow {
    color: #005EB8;
}

.btn-primary, .btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary, .btn-clear {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary {
    margin-bottom: 10px;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #667eea 10%, #00ff2a 100%);
    color: white;
}


.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}


/* Ensure the inner containers take up the full card width */
#authSection, #setupContent {
    width: 100%;
    transition: all 0.3s ease;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.auth-footer {
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
 
/* Optional: Add a fade-in effect when switching from Login to Slider */
#setupContent {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Business Registration Form Styles
   ============================================ */

.user-details-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.user-details-form label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569; /* Slate 600 */
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.user-details-form input,
.user-details-form select,
.user-details-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #cbd5e1; /* Slate 300 */
    border-radius: 8px;
    background-color: #f8fafc; /* Slate 50 */
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.2s ease;
    font-family: inherit;
}

.user-details-form input:focus,
.user-details-form select:focus,
.user-details-form textarea:focus {
    outline: none;
    border-color: #005EB8;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(0, 94, 184, 0.1);
}

.user-details-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Mobile: Stack columns */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Loading Screen
   ============================================ */
/* Center the container itself within the fixed loading screen */
#appLoadingScreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95); /* Slightly more opaque to hide bg */
    z-index: 9999;
    display: none; /* Hidden by default, shown via JS */
    align-items: center;
    justify-content: center;
}

#appLoadingScreen.active {
    display: flex !important;
}

.loader-content {
    display: flex;
    flex-direction: column; /* Stack P and Spinner vertically */
    align-items: center;    /* Center them horizontally relative to each other */
    justify-content: center;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e2e8f0;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-top: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Dashboard
   ============================================ */

#dashboardScreen {
    width: 100%;
}

.dashboard {
    width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
    gap: 20px;
    padding: 20px;
    padding-bottom: 40px;   
}

.header {
    background: linear-gradient(135deg, #90a0e8 40%, #00bf00 100%);
    padding: 20px 0;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* Remove max-width if you want it full screen, or set to 500px for a centered look */
    min-height: 100vh; 
    height: auto;
    max-width: 360px; 
    
    /* Layout logic */
    display: flex;
    flex-direction: column;
    position: relative;
}

.header-content {
    display: flex;
    flex-direction: column; /* Force everything into one single vertical column */
    padding: 0 20px;
    gap: 15px;
    width: 100%;
    flex: 1;
}

.header-profile-email, 
#headerUserEmail {
    white-space: normal;       /* Allows text to wrap */
    word-break: break-all;     /* Breaks long strings (like long emails) if necessary */
    line-height: 1.2;          /* Ensures readable spacing between wrapped lines */
    max-width: 180px;          /* Adjust this based on your header's available space */
    font-size: 0.75rem;        /* Keeps it slightly smaller to help it fit */
    color: rgba(255, 255, 255, 0.8);
}

.header-profile-info {
    display: flex;
    flex-direction: column;    /* Keeps Name and Email stacked vertically */
    justify-content: center;
}

.header-actions {
    display: flex !important;
    flex-direction: row !important;
    width: 100%;
    margin-top: 0 !important;
    /* justify-content: space-between distributes them evenly across the bottom */
}

.header-actions .btn-icon {
    padding: 10px;
    background: linear-gradient(90deg, #00ff1a 0%, #667eea 80%);

    border-radius: 50%; /* Circular buttons look great in a row */
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0; /* Managed by inline margins for precision */
    flex: 1;
}

/* Ensure the profile card doesn't clash with header background */
.profile-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-info h2, .profile-info p {
    margin: 2px 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header .title {
    font-size: 2em;
    color: white;
    margin: 0;
}

/* ============================================
   Modern Toast Notifications
   ============================================ */

#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001; /* Above all modals */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(30, 41, 59, 0.9); /* Deep slate */
    backdrop-filter: blur(12px);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: toastSlideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
}

.toast.success {
    border-left: 4px solid #00ff2a;
}

.toast.error {
    border-left: 4px solid #ff4d4d;
}

.toast .material-symbols-rounded {
    font-size: 1.2rem;
}

@keyframes toastSlideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.toast.fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

@keyframes toastFadeOut {
    to { 
        opacity: 0; 
        transform: translateY(-10px) scale(0.95); 
    }
}

/* ============================================
   User Selector
   ============================================ */

.user-selector-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 0 !important;
}

.user-selector-container label {
    font-weight: 600;
    color: white;
    font-size: 0.95em;
}

.user-selector {
    padding: 10px 15px;
    border: 2px solid #e8ecff;
    border-radius: 18px;
    background: linear-gradient(135deg, #667eea 10%, #00ff2a 100%);
    color: white;
    font-weight: 500;
    cursor: pointer;
}

.user-selector option {
    background-color: #667eea; /* Solid blue from your gradient */
    color: white;
    /* border-radius and gradients will not work here */
}

.user-selector:hover {
    border-color: #667eea;
}

.user-selector:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Vertical state (Default) */
.header-actions.stack-column {
    flex-direction: column;
    align-items: center;
}

/* Horizontal state (When it drops below) */
.header-actions.stack-row {
    flex-direction: row;
    width: 100%;
    justify-content: center;
    gap: 30px;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}
/* ============================================
   Widgets
   ============================================ */

.widget {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.widget:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.widget-title {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.widget-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* ============================================
   Quick Links
   ============================================ */
/* Custom Prompt Specific Styling */
#customPromptModal .modal-card {
    border-top: 5px solid #667eea; /* Matches your section branding */
}

#customPromptInput {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    font-size: 1rem;
    color: #1e293b;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    margin-top: 10px;
}

#customPromptInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background-color: white;
}

.quick-links-widget {
    grid-column: 1 / -1;
    width: 100%;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.quick-links-grid {
    display: flex;
    flex-wrap: wrap; 
    gap: 15px;
    padding: 20px 10px;
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal growth */
}

.quick-link {
    position: relative;
    flex: 0 0 100px; /* Base size */
    width: 100px;    /* Force width */
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 5px;   /* Added requested padding */
    text-decoration: none;
    background: linear-gradient(135deg, #008aa5 0%, #00ff48 100%);
    border-radius: 16px;
    color: #000;
    transition: transform 0.2s;
}

.quick-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.quick-link span:not(.material-symbols-rounded) {
    width: 100%;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Forces the "..." */
    padding: 0 5px; /* Side padding for the text */
}

.add-btn {
    background: #f8f9fa;
    border: 2px dashed #667eea;
    color: #667eea;
}

/* ============================================
   Delete Buttons & Add Button
   ============================================ */

.link-action-buttons {
    position: absolute;
    top: -8px;
    right: -8px;
    z-index: 10;
    display: none;
    flex-direction: column;
    gap: 5px;
}

.quick-link:hover .link-action-buttons {
    display: flex;
}

.delete-btn {
    background: #ff4d4d;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: -8px 8px 3px rgba(0,0,0,0.2);
}

/* Delete button for individual sections */
.delete-section-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.delete-section-btn:hover {
    background: #fecaca;
}

/* ============================================
   User Sections & Profile
   ============================================ */

.user-sections {
    grid-column: 1 / -1;
    width: 100%;
}

.profile-picture {
        width: 100px;
        height: 100px;
        object-fit: cover;
        border: 3px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        background: #fff;
        transition: all 0.3s ease;
        border-radius: 50%;
    }

.user-section {
    margin-bottom: 0 !important;
    animation: fadeIn 0.3s ease;
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: block;
    gap: 15px;
    transition: all 0.3s ease;
    overflow: visible !important; /* Change from auto/hidden to visible */
    position: relative;
    z-index: 1;
    max-width: 100%;
    overflow-x: hidden !important;
}

.user-section:hover {  
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    overflow-x: auto;
    gap: 15px;
}

.user-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.user-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.3em;
}

#uploadPictureBtn{
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    margin-top: -30px;
    margin-left: -5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;

}
.user-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: 600;
    resize: vertical;
    margin-bottom: 15px;
}
.user-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.user-actions button {
    flex: 1; 
    padding: 12px;
    white-space: nowrap;
}   

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-clear:hover {
    background: #e8e8e8;
}

/* The toggle switch container */
/* Toggle Switch Design */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;   /* Increased width */
  height: 30px;  /* Increased height */
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* High-End Editor Styling */
.editor-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.3s ease;
}

.editor-wrapper:focus-within {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #667eea;
}

/* Customizing the Quill Toolbar */
.ql-toolbar.ql-snow {
    border: none !important;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0 !important;
    padding: 12px !important;
}

.ql-container {
    min-height: 200px;
}

/* Customizing the Text Area */
.ql-container.ql-snow {
    border: none !important;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    min-height: 250px; /* More substantial height */
}

.ql-editor {
    line-height: 1.6;
    color: #1e293b;
    -webkit-user-select: text;
    user-select: text;
    touch-action: manipulation;
    cursor: text;
}

.ql-editor.ql-blank::before {
    color: #94a3b8;
    font-style: normal;
}

.ql-snow .ql-tooltip {
    z-index: 1000; /* Ensure it stays above everything */
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
    background-color: white !important;
    left: 5% !important; /* Force it toward the center of the editor */
    transform: translateX(-80%);
}

.header-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-info-list li {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.15); /* Darker background for legibility */
    padding: 10px 14px;
    border-radius: 12px;
    color: white;
    font-size: 0.85rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.header-info-list li span.material-symbols-rounded {
    font-size: 18px;
    margin-right: 10px;
    opacity: 0.9;
}

.list-label {
    font-weight: 500;
    opacity: 0.8;
}

.list-value {
    font-weight: 700;
    color: #00ff2a; 
    margin-left: auto; /* This pushes the "Active/Count" text to the far right */
}

/* 3. Ensure the wrapper allows overflow but keeps the border tidy */
.editor-wrapper {
    overflow: visible; /* Crucial for pop-ups */
    pointer-events: auto !important;
    position: relative;
    z-index: 5; /* Ensure it stays above any background elements */
}

/* ============================================
   User Selector
   ============================================ */
 
.slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg, #00ff1a 0%, #667eea 80%);
  outline: none;
  appearance: none;
  cursor: pointer;
  position: absolute;
  transition: .4s;
}

.round{
    border-radius: 15px;
    height: 30px;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #15ff00;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;  /* Increased circle size */
  width: 22px;   /* Increased circle size */
  left: 4px;     /* Adjusted spacing from left */
  bottom: 4px;   /* Adjusted spacing from bottom to center it vertically */
  transition: .4s;
  border-radius: 50%;
  background: white;
  box-shadow: 0 10px 5px rgba(102, 126, 234, 0.8);
}

input:checked + .slider {
  background-color: #667eea;
}

input:checked + .slider:before {
  /* This moves the circle across the wider track */
  /* Calculation: Width(60) - Circle(22) - LeftSpace(4) - RightSpace(4) = 30px */
  transform: translateX(30px); 
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

/* Modal Card */
.modal-card {
    background: white;
    width: 100%;
    max-width: 450px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    overflow: hidden;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 0px 25px;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.modal-body {
    padding: 5px;
}

.settings-group h3 {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 5px;
}

.settings-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.setting-item span {
    font-weight: 600;
    color: #334155;
}

.btn-icon-dark {
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
}

.modal-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 2000;
}
.modal-overlay.active { display: flex; }
.modal-card {
    background: white; width: 90%; max-width: 400px;
    border-radius: 20px; padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.settings-group-header { font-weight: 800; font-size: 0.8rem; color: #667eea; text-transform: uppercase; margin-bottom: 10px; }
.setting-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.settings-subtitle { font-size: 0.8rem; color: #666; margin-bottom: 15px; }

/* This ensures the registration screen covers the entire window */
#businessSetupScreen {
    position: fixed; /* BREAKS out of the header/main layout */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('mountain-bg.webp');
    background-size: cover;
    background-position: center;
    z-index: 9999; /* Sits on top of the dashboard and header */
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    overflow-y: auto; /* Allows scrolling if the form is long */
    padding: 20px;
}

/* When the .active class is added via JS */
#businessSetupScreen.active {
    display: flex !important;
    opacity: 1;
}

/* Ensure the card inside is visible */
#businessSetupScreen .details-container {
    width: 100%;
    max-width: 500px;
    margin: auto; /* Centers the card vertically if scrolling is needed */
}

#biz_sector {
    height: 44px; /* Matches standard input height */
    appearance: none; /* Removes default browser arrows if you want custom styling */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

#businessModal .modal-footer .btn-secondary:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: #764ba2;
    color: #764ba2;
}

/* ============================================
   Document List Fixes
   ============================================ */

.file-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* This targets the container created in your renderDocuments function */
.file-list > div {
    width: 100% !important;
    max-width: 100%;
    overflow: hidden;
    padding: 5px; /* Added requested padding */
}

.file-list a {
    flex: 1;
    min-width: 0; /* Allows shrinking */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 5px;
}

/* Admin Badge Styling */
.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #00ff2a 0%, #008aa5 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 50px;
    margin-left: 10px;
    vertical-align: middle;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(0, 255, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-badge span {
    font-size: 12px !important;
}

/* Ensure the profile name container can handle the badge wrapping */
#profileName {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.status-tag.pending {
    background: #fbbf24; /* Amber/Yellow */
    color: #78350f;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 900;
    margin-left: 8px;
    vertical-align: middle;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}



@media (max-width: 675px) {
    .dashboard {
        grid-row: 2; /* Explicitly set to bottom row */
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Better */
    }

    /* 2. Header Content Management */
    .header-content {
        display: flex;
        flex-direction: row; 
        flex-wrap: wrap; /* CRITICAL: Allows items to move to a new line if too tight */
        justify-content: space-between; 
        align-items: flex-start; 
        width: 100%;
        padding: 0 20px 0 20px;
        gap: 5px;
    }

    .header-info-list{
        display: none !important;
    }

    .header-footer{
        display: none !important;
    
    }

    .header-left {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap; /* Allows the selector/profile to drop below the title if needed */
        align-items: flex-start; 
        gap: 5px; 
    }

    .link-action-buttons {
        display: flex;
    }

    /* 3. Elements & Widgets */
    .profile-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .user-section {
        max-width: 100%;
        overflow-x: hidden !important; 
    }

    .user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .user-textarea { 
        min-height: 150px;
    }

    #dashboardScreen.active {
        display: block !important;
    }

    .header {
        min-height: auto; /* Remove the full-screen requirement on mobile */
        max-width: 100%;  /* Let it span the full width */
        padding-bottom: 10px;
        padding-top: 10px;
    }
    
    .header-legal-footer {
        margin-top: 20px; /* Space it out manually since flex-grow is gone */
    }
    h1#mainTitle.title{
        display: none !important;
    }
    .form-row {
        flex-direction: column;
    }
    .profile-section {
        margin: 0 !important;
    }
    .quick-links-grid {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .quick-links-grid::-webkit-scrollbar {
        display: none;
    }

    .user-actions {
        flex-direction: column;
    }
}
    @media (max-width: 480px){
     /* 1. Enable scrolling while hiding the overflow container */
    .quick-links-grid {
        overflow-x: auto;
        white-space: nowrap;
        display: flex; /* Ensures items stay in a line to allow scrolling */
        
        /* Hide scrollbar for Firefox */
        scrollbar-width: none;
        
        /* Hide scrollbar for IE and Edge */
        -ms-overflow-style: none;
    }

    /* 2. Hide scrollbar for Chrome, Safari, and Opera */
    .quick-links-grid::-webkit-scrollbar {
        display: none;
    }
    .ql-snow .ql-tooltip {
        transform: none;
        font-size: 1rem;
        margin-left: -60px;
    }
    }