:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #475569;
    --secondary-dark: #334155;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1);
    --radius: 8px;
    --transition: all 0.2s ease-in-out;
    --linkedin: #0A66C2;
    --indeed: #2557a7;
    --dice: #f08000;
}

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

body {
    font-family: 'Roboto', sans-serif;
    color: #334155;
    background-color: #f0f2f5;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 25px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--warning);
    transition: background-color 0.5s ease;
}

.light.connected {
    background-color: var(--success);
}

.light.disconnected {
    background-color: var(--danger);
}

/* Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Panels */
.panel {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-body {
    padding: 20px;
}

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

/* Global Controls Panel */
.global-controls-panel .panel-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.automation-bottom-controls {
    margin-top: auto;
}

.global-controls-panel .form-group {
    margin-bottom: 10px;
}

.separator {
    height: 1px;
    background-color: var(--border);
    margin: 20px 0;
}

.global-controls-panel h3 {
    margin-bottom: 15px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-grid {
    margin-bottom: 15px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
}

.status-item:nth-child(odd) {
    background-color: #f1f5f9;
}

#manual-refresh-btn {
    margin-top: 10px;
}

/* User Stats Section */
.user-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.stat-card {
    background-color: #f8fafc;
    padding: 15px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-card-label {
    font-size: 14px;
    color: var(--gray);
    margin-top: 4px;
}

.user-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 5px;
    font-weight: 700;
    font-size: 10px;
    color: var(--secondary-dark);
    text-transform: uppercase;
}

.user-header-name {
    flex-grow: 1;
    padding-left: 5px;
}

.user-header-values {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.user-header-platform {
    width: 70px;
}

.user-header-status {
    width: 90px;
}

.user-header-reset {
    width: 30px;
}

.user-header-eligibility {
    width: 50px;
}

.user-header-retry {
    width: 40px;
}

.user-header-remaining {
    width: 70px;
}

.user-header-history {
    width: 40px;
}

.user-stats-list {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 20px;
}

.user-stats-list::-webkit-scrollbar {
    width: 6px;
}

.user-stats-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.user-stats-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.user-stats-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.user-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    background-color: var(--light);
    border: 1px solid var(--border);
    transition: var(--transition);
    gap: 10px;
}

.user-stat-item:hover {
    background-color: #f1f5f9;
}

.user-stat-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.user-stat-values {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.user-stat-platform {
    width: 70px;
    text-align: center;
    font-size: 18px;
}

.user-stat-platform .fa-linkedin {
    color: var(--linkedin);
}

.user-stat-platform .fa-briefcase {
    color: var(--indeed);
}

.user-stat-platform .fa-dice {
    color: var(--dice);
}

.user-stat-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 12px;
    width: 90px;
    text-align: center;
    color: white;
}

.status-in-queue {
    background-color: var(--gray);
    font-size: xx-small;
}

.status-active {
    background-color: var(--primary);
    animation: pulse-bg 1.5s infinite;
}

.status-stopping {
    background-color: var(--warning);
    color: var(--dark);
}

.status-complete {
    background-color: var(--success);
}

.status-failed-max-time {
    background-color: var(--danger);
}

.status-failed {
    background-color: var(--warning);
    color: var(--dark);
}


.btn-reset-eligibility,
.btn-history {
    background: none;
    border: none;
    color: var(--secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    line-height: 1;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-reset-eligibility:hover {
    background-color: #e2e8f0;
    color: var(--danger);
}

.btn-history {
    width: 40px;
}

.btn-history:hover {
    background-color: #e2e8f0;
    color: var(--info);
}

.btn-history:disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.btn-history:disabled:hover {
    background-color: transparent;
}


.user-stat-eligibility {
    font-size: 16px;
    width: 50px;
    text-align: center;
    color: var(--success);
}

.user-stat-eligibility .fa-times-circle {
    color: var(--danger);
}

.user-stat-retries {
    font-size: 12px;
    font-weight: 500;
    background-color: var(--warning);
    color: white;
    padding: 2px 7px;
    border-radius: 12px;
    min-width: 25px;
    text-align: center;
    width: 40px;
}

.user-stat-jobs {
    font-size: 13px;
    font-weight: 700;
    background-color: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 30px;
    text-align: center;
    width: 70px;
}

.user-stat-jobs.zero {
    background-color: var(--gray);
}

/* Servers Panel & Compact Card Styles */
.servers-list-container {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 15px;
}

.server-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    background-color: white;
    overflow: hidden;
}

.server-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}

.server-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 4px;
}

.server-name:hover,
.server-name[contenteditable="true"] {
    background-color: #e2e8f0;
    outline: 2px solid var(--primary);
}

.server-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.idle {
    background-color: var(--gray);
}

.status-dot.running {
    background-color: var(--primary);
    animation: pulse 1.5s infinite;
}

.server-card-body {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-card-body .form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.server-card-body .form-group label {
    margin-bottom: 0;
    font-size: 13px;
    color: var(--gray);
}

.server-card-body .form-group input[type="number"] {
    width: 65px;
    padding: 4px 8px;
    font-size: 13px;
    text-align: center;
}

.server-card-body .switch-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
}

.server-card-body .switch-group label {
    font-size: 13px;
    color: var(--gray);
}

.server-card-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    background-color: #f8fafc;
}

.server-action-btn {
    flex: 0;
    padding: 8px;
    font-size: 12px;
}

/* Accordion Styles */
.accordion {
    border-top: 1px solid var(--border);
}

.accordion-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: #f8fafc;
    border: none;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    color: var(--secondary-dark);
    transition: var(--transition);
}

.accordion-toggle:hover {
    background: #f1f5f9;
}

.accordion-toggle .active-user-count {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.accordion-toggle .fas {
    transition: transform 0.2s ease-in-out;
}

.accordion.active .accordion-toggle .fas {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 12px;
    background: white;
}

.accordion.active .accordion-content {
    max-height: 500px;
    padding: 12px;
}

.active-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.active-users-table th,
.active-users-table td {
    padding: 6px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.active-users-table th {
    font-weight: 700;
    color: var(--gray);
}

.active-users-table .user-stat-name {
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.platform-icon {
    font-size: 16px;
    text-align: center;
}

.platform-icon.linkedin {
    color: var(--linkedin);
}

.platform-icon.indeed {
    color: var(--indeed);
}

.action-btn-group {
    display: flex;
    gap: 5px;
}

.btn-kill-user,
.btn-view-user-logs {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 4px;
}

.btn-kill-user {
    color: var(--danger);
}

.btn-kill-user:hover {
    background-color: #fee2e2;
}

.btn-view-user-logs {
    color: var(--info);
}

.btn-view-user-logs:hover {
    background-color: #e0f2fe;
}

/* Forms & Buttons */
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 8px;
    white-space: nowrap;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-dark);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #b91c1c;
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #15803d;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    border-radius: 50%;
    transition: var(--transition);
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1);
    animation: slide-down 0.3s ease-out;
}

.modal-content.wide {
    max-width: 900px;
}

@keyframes slide-down {
    from {
        transform: translateY(-30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    border: none;
    background: none;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body input {
    width: 100%;
    margin-bottom: 15px;
    padding: 10px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #f8fafc;
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

#log-search-bar {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

#modal-logs-list {
    font-family: 'Menlo', 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.7;
    color: #334155;
}

.log-item {
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    display: flex;
    gap: 15px;
}

.log-item.hidden {
    display: none;
}

.log-item .log-time {
    color: var(--gray);
    white-space: nowrap;
}

.log-item .log-msg {
    word-break: break-all;
}

.log-item.info {
    background-color: #eff6ff;
}

.log-item.success {
    background-color: #f0fdf4;
}

.log-item.warning {
    background-color: #fffbeb;
}

.log-item.error {
    background-color: #fef2f2;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.history-table th {
    background-color: #f8fafc;
}

/* Misc */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--gray);
}

.spinner {
    border: 4px solid rgba(0, 0, 0, .1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--primary);
    animation: spin 1s ease infinite;
    margin: 20px auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.notification {
    position: fixed;
    bottom: 25px;
    right: 25px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow);
    z-index: 1001;
    transform: translateX(calc(100% + 30px));
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background-color: var(--success);
}

.notification.error {
    background-color: var(--danger);
}

.notification.info {
    background-color: var(--info);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, .7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(37, 9, 235, 0);
    }

    100% {
        box-shadow: 0 0 0 rgba(37, 99, 235, 0);
    }
}

@keyframes pulse-bg {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
    }
}

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

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

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

/* Platform checkbox styling for LinkedIn and Indeed */
.user-stat-platform {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
}

.user-header-platform {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
}

.user-header-platform i {
    font-size: 16px;
}

/* Style for platform checkboxes */
.platform-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.linkedin-checkbox {
    accent-color: #0077b5;
    /* LinkedIn blue */
}

.indeed-checkbox {
    accent-color: #003366;
    /* Indeed blue */
}

.dice-checkbox {
    accent-color: #f08000;
    /* Dice orange */
}

/* Platform icon styling to use JPG files */
.platform-icon {
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.platform-icon.linkedin {
    background-image: url('linkedin.jpg');
}

.platform-icon.indeed {
    background-image: url('indeed.jpg');
}

.platform-icon.dice {
    background-image: url('dice.jpg');
}

/* Platform icon images for headers */
.platform-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Connection Scraping Modal Styles */
#connection-scraping-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.progress-container {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-weight: 500;
    color: var(--gray);
    margin-bottom: 15px;
}

.status-log {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    background-color: #f8fafc;
}

.status-log-entry {
    margin-bottom: 8px;
    font-size: 13px;
    padding: 5px 0;
    border-bottom: 1px solid #e2e8f0;
}

.status-log-entry:last-child {
    border-bottom: none;
}

.log-timestamp {
    color: var(--gray);
    font-size: 1px;
    margin-right: 8px;
}

#scraping-results-section {
    display: none;
}

.select-all-container {
    margin-bottom: 15px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.connections-table-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 15px;
}

.connections-table {
    width: 100%;
    border-collapse: collapse;
}

.connections-table th,
.connections-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.connections-table th {
    background-color: #f1f5f9;
    position: sticky;
    top: 0;
}

.connections-table input[type="checkbox"] {
    margin: 0;
}

.connections-table a {
    color: var(--primary);
    text-decoration: none;
}

.connections-table a:hover {
    text-decoration: underline;
}

/* Single User Modal Platform Selection Styles */
.platform-selection {
    margin-top: 15px;
}

.platform-selection p {
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--secondary-dark);
}

.platform-checkboxes {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 15px;
}

.platform-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    transition: var(--transition);
    border: 2px solid transparent;
}

.platform-checkbox-label:hover {
    background-color: #f8fafc;
}

.platform-checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.platform-checkbox-label i {
    font-size: 18px;
}

.platform-checkbox-label:has(#platform-linkedin) {
    border-color: var(--linkedin);
}

.platform-checkbox-label:has(#platform-indeed) {
    border-color: var(--indeed);
}

.platform-checkbox-label:has(#platform-dice) {
    border-color: var(--dice);
}

.platform-checkbox-label:has(input:checked) {
    background-color: rgba(37, 99, 235, 0.1);
}

/* End Connection Scraping Modal Styles */
