body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    padding: 20px; 
    max-width: 900px; 
    margin: 0 auto; 
    background-color: #f0f2f5;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
    min-height: 100vh;
}
h1 { color: #333; }
#controls { margin-bottom: 20px; }
button {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
    margin-right: 10px;
    margin-bottom: 10px;
}

/* Send Emails Button - Blue */
#sendEmailsBtn { background-color: #007bff; }
#sendEmailsBtn:hover { background-color: #0056b3; }
#sendEmailsBtn:disabled { background-color: #ccc; cursor: not-allowed; }

/* Reload Button - Green */
#viewBtn { background-color: #28a745; }
#viewBtn:hover { background-color: #218838; }

#terminal {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-radius: 6px;
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    white-space: pre-wrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 30px; 
}

/* Progress Bar Styling */
#progressContainer {
    display: none; /* Hidden by default */
    margin-bottom: 20px;
    background-color: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    height: 30px;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
#progressBar {
    width: 0%;
    height: 100%;
    background-color: #17a2b8; /* Info Blue/Cyan */
    text-align: center;
    line-height: 30px;
    color: white;
    font-weight: bold;
    font-size: 14px;
    transition: width 0.3s ease;
}

/* Table Styling */
#tableContainer {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: none;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}
th, td {
    border: 1px solid #dee2e6;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}
th {
    background-color: #343a40;
    color: #fff;
    font-weight: bold;
}

/* Alternating Colors */
.row-even { background-color: #f2f2f2; }
.row-odd { background-color: #faf0e6; }

.member-cell {
    vertical-align: top;
    font-weight: 600;
}
.merged-cell {
    border-top: none;
    border-bottom: none;
}
.skill-cell { color: #333; }
.date-cell { color: #555; white-space: nowrap; }
.no-skill { color: #28a745; font-style: italic; }

/* Checkbox Styling */
.email-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    font-size: 14px;
}
.email-label input {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}
/* Header Checkbox specific style */
.header-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: white;
}
.header-checkbox-label input {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}
#logoutBtn {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: #dc3545; /* Danger Red */
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.2s;
}

#logoutBtn:hover {
    background-color: #c82333; /* Darker Red on hover */
}

/* --- SCROLL TO TOP BUTTON --- */
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-size: 18px;
    border: none;
    outline: none;
    background-color: #343a40;
    color: white;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: background-color 0.3s, transform 0.3s, opacity 0.3s;
}

#scrollTopBtn:hover {
    background-color: #23272b;
    transform: translateY(-3px);
}
/* --- MODAL STYLES --- */
.modal {
    display: none; /* Hidden by default */
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgb(0,0,0); 
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto; /* Reduced top margin to allow more space */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; 
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    position: relative;
    animation: animatetop 0.4s;
    /* Added scrollbar support */
    max-height: 80vh;
    overflow-y: auto;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Add Animation */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}
/* --- TOP LEFT PROFILE MENU --- */
.profile-menu {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}
.profile-btn {
    background-color: white;
    color: #333;
    padding: 10px 16px;
    font-size: 16px;
    border: 1px solid #ddd;
    cursor: pointer;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.profile-btn:hover { background-color: #f8f9fa; transform: translateY(-1px); }
.profile-dropdown {
    left: 0; right: auto; /* Align left */
    min-width: 160px;
}
/* --- PASSWORD INPUT GROUP --- */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrapper input {
    padding-right: 40px; /* Make room for the button */
}
.btn-toggle-pw {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-toggle-pw:hover {
    color: #333;
}
/* --- GLOBAL HELP SYSTEM --- */

#globalHelpBtn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #17a2b8; /* Info Cyan */
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    margin: 0;
    padding: 0; /* Ensure no padding shrinks the icon */
}

/* NEW: Explicitly style the icon */
#globalHelpBtn svg {
    width: 24px;
    height: 24px;
    stroke: white;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#globalHelpBtn:hover {
    background-color: #138496;
    transform: scale(1.1);
}

/* Modal Overlay */
.help-modal-overlay {
    display: none;
    position: fixed; 
    z-index: 3000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    opacity: 0;
    transition: opacity 0.3s ease;
}

.help-modal-overlay.show {
    display: block;
    opacity: 1;
}

/* Modal Content */
.help-modal-content {
    background-color: #fefefe;
    margin: 10vh auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.3s ease-out;
    /* Added scrollbar support */
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.help-close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.help-close-btn:hover {
    color: #000;
}

.help-body {
    line-height: 1.6;
    color: #333;
}

.help-body ul, .help-body ol {
    padding-left: 20px;
    margin-top: 10px;
}

.help-body li {
    margin-bottom: 8px;
}
/* ... (Keep existing styles) ... */

/* --- EVENT LOG FILTERS --- */
.filter-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

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

.filter-group label {
    font-weight: bold;
    font-size: 13px;
    color: #555;
}

/* Event Type Chips */
.type-toggles {
    display: flex;
    gap: 8px;
}

.type-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f8f9fa;
    color: #666;
    user-select: none;
    transition: all 0.2s;
}

.type-badge.active {
    background-color: #343a40;
    color: white;
    border-color: #343a40;
}

/* Custom Colors for Active States */
.type-badge[data-type="System"].active { background-color: #17a2b8; border-color: #17a2b8; }
.type-badge[data-type="Members"].active { background-color: #28a745; border-color: #28a745; }
.type-badge[data-type="Skills"].active { background-color: #ffc107; border-color: #ffc107; color: #333; }
.type-badge[data-type="Email"].active { background-color: #007bff; border-color: #007bff; }

/* Filter Inputs */
.filter-select, .filter-date {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 140px;
}

.btn-filter {
    background-color: #007bff;
    color: white;
    padding: 9px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}
.btn-filter:hover { background-color: #0056b3; }

.btn-reset-filter {
    background-color: #6c757d;
    color: white;
    padding: 9px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.btn-reset-filter:hover { background-color: #5a6268; }

/* --- PAGINATION CONTROLS --- */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.pagination-buttons {
    display: flex;
    gap: 5px;
}

.btn-page {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-page:hover:not(:disabled) {
    background-color: #e9ecef;
}

.btn-page:disabled {
    color: #ccc;
    cursor: not-allowed;
    background: #f8f9fa;
}

.btn-page.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}
/* [NEW] Round Icon Button */
.btn-round {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #007bff;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    margin: 0;
}

.btn-round:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-round svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
    /* Optional: slightly offset the plane icon to look optically centered */
    margin-right: 2px; 
    margin-top: 2px;
}
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/*  Demo Banner Global Style */
.demo-banner {
    background-color: #ffc107;
    color: #333;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    /* Negative margin to counteract body padding (20px) and stretch edge-to-edge */
    margin: -20px -20px 20px -20px; 
    border-bottom: 1px solid #e0a800;
    display: none; /* Hidden by default */
    font-size: 14px;
    position: relative;
    z-index: 50; /* Ensure it sits below absolute menus (z-index 100) */
}