/* Form Row */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    /* Double-tap expansion on mobile */
    #tasksTable tr.expanded {
        padding: 20px;
        background-color: var(--bg-tertiary);
        z-index: 10;
        border: 1px solid var(--primary-color);
    }
    
    #tasksTable tr.expanded td:nth-child(2) {
        display: block;
        padding: 0;
        margin-bottom: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 12px;
    }
    
    #tasksTable tr.expanded td:nth-child(2):before {
        position: static;
        display: block;
        width: 100%;
        padding: 0;
        margin-bottom: 8px;
        color: var(--text-tertiary);
        font-size: 12px;
        font-weight: 400;
    }
    
    /* Mobile task card help hint */
    #tasksTable tr:first-child::after {
        content: "Tip: Double-tap to see more details";
        position: absolute;
        bottom: -8px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 11px;
        background-color: var(--bg-tertiary);
        color: var(--text-tertiary);
        padding: 2px 8px;
        border-radius: 4px;
        white-space: nowrap;
        opacity: 0.8;
        pointer-events: none;
        border: 1px solid var(--border-color);
    }
}

:root {
    /* Dark Theme Color Palette - Modern Blue Scheme */
    --primary-color: #0EA5E9;
    --primary-hover: #0284C7;
    --secondary-color: #64748B;
    --accent-color: #0EA5E9;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #0EA5E9;
    --success-color: #10B981;
    
    /* Dark Backgrounds */
    --bg-primary: #0F1419;
    --bg-secondary: #1A202C;
    --bg-tertiary: #2D3748;
    --bg-quaternary: #4A5568;
    
    /* Dark Borders and Dividers */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.15);
    
    /* Dark Text Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #CCCCCC;
    --text-tertiary: #94A3B8;
    --text-muted: #64748B;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    
    /* Layout Variables */
    --sidebar-width: 80px;
    --header-height: 48px;
    --border-radius: 8px;
    --transition-speed: 0.2s;
}

/* Global scrollbar hiding */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    display: none;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.07) 0%, transparent 50%);
}

/* Action Grid */
.action-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.75rem 1rem !important;
    border-radius: var(--border-radius) !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all var(--transition-speed) ease !important;
    border: 1px solid var(--border-color) !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    min-width: 120px !important;
    height: 36px !important;
}

.action-btn:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: white !important;
}

.action-btn svg {
    margin-right: 0.5rem !important;
    width: 16px !important;
    height: 16px !important;
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
    align-items: center;
}

.logo {
    margin-bottom: 40px;
    color: var(--accent-primary);
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.05em;
}

.logo-sub {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
}

.nav-links {
    list-style: none;
    padding: 0;
    width: 100%;
}

.nav-item {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.nav-item:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.1);
}

.nav-item.active:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background-color: var(--primary-color);
}

.nav-item svg {
    width: 24px;
    height: 24px;
    opacity: 0.6;
    transition: opacity var(--transition-speed) ease;
}

.nav-item:hover svg,
.nav-item.active svg {
    opacity: 1;
}

.nav-item span {
    display: none;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 30px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 0;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.user-actions {
    display: flex;
    align-items: center;
}

.connection-status {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger-color);
    margin-right: 8px;
}

.connection-status.connected .status-dot {
    background-color: var(--success-color);
}

.status-text {
    font-weight: 500;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h1 {
    font-size: 24px;
    font-weight: 700;
}

/* Dashboard Summary */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

.stat-card:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Cards */
.card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

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

/* Section-specific card body adjustments */
#proxies .card-body {
    padding: 20px;
}

#settings .card-body {
    padding: 20px;
}

/* General card body */
.card-body {
    padding: 20px;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    border: none;
    font-size: 14px;
    line-height: 1.5;
    height: 36px;
}

.btn svg {
    margin: 0;           /* Remove ALL margins */
    width: 16px;
    height: 16px;
    display: block;      /* Ensure block-level behavior */
}

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

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}


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

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

.btn-small.delete-btn:hover {
    background-color: #DC2626;
    border-color: #DC2626;
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #DC2626;
}

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

.btn-warning:hover {
    background-color: #D97706;
}

/* Form Elements */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.input-field, .select-field, .proxies-textarea {
    width: 100%;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-speed) ease;
    height: 36px;
}

.editable-field, .input-field:focus, .select-field:focus, .proxies-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.select-field {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' 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 10px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Proxies section - remove padding to match accounts table layout */
#proxies .card-body {
    padding: 0;
}

.proxies-textarea {
    width: 100%;
    min-height: 400px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    height: auto;
    line-height: 1.5;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 20px;
    margin: 0;
}

.proxies-textarea:focus {
    outline: none;
    background-color: var(--bg-tertiary);
}

/* Ensure accounts section maintains its layout */
#accounts .card-body {
    padding: 0;
}

#accounts .table-responsive {
    width: 100%;
}

/* Settings Groups */
.settings-group {
    margin-bottom: 25px;
    padding: 20px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.sg{
    display: flex;

}

.setting-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Master Toggle Container */
.master-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
    padding: 8px 12px;
    background-color: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.toggle-label-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-speed) ease;
}

.master-toggle-container .toggle-input:not(:checked) + .toggle-label + .toggle-label-text {
    color: var(--primary-color);
}

.master-toggle-container .toggle-input:checked ~ .toggle-label-text:last-child {
    color: var(--primary-color);
}

/* Account Toggle Container */
.account-toggle-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.account-toggle-container .toggle-label-text {
    font-size: 11px;
    min-width: 35px;
    text-align: center;
}

.account-toggle-container .toggle-switch {
    width: 40px;
    height: 20px;
}

.account-toggle-container .toggle-label:before {
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
}

.account-toggle-container .toggle-input:checked + .toggle-label:before {
    transform: translateX(20px);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--primary-color);
    transition: .4s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.toggle-label:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-input:checked + .toggle-label {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.toggle-input:checked + .toggle-label:before {
    transform: translateX(24px);
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
    /* border-radius: var(--border-radius); */
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

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

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
}

.data-table th {
    background-color: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.empty-message {
    text-align: center;
    color: var(--text-tertiary);
    font-style: italic;
    padding: 40px 20px;
}

/* Badge Styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge:before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-badge.running {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.status-badge.running:before {
    background-color: var(--success-color);
}

.status-badge.pending {
    background-color: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.status-badge.pending:before {
    background-color: var(--warning-color);
}

.status-badge.completed {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary-color);
}

.status-badge.completed:before {
    background-color: var(--primary-color);
}

.status-badge.failed {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
}

.status-badge.failed:before {
    background-color: var(--danger-color);
}

.status-badge.stopped {
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-secondary);
}

.status-badge.stopped:before {
    background-color: var(--text-secondary);
}

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

.modal-content {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--border-color);
    animation: modalOpen 0.3s ease;
}

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

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid var(--border-color);
    gap: 10px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 12px 16px;
    margin-top: 12px;
    max-width: 350px;
    border: 1px solid var(--border-color);
    animation: toastIn 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.info {
    border-left-color: var(--info-color);
}

.toast-icon {
    margin-right: 12px;
    width: 24px;
    height: 24px;
    min-width: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-success .toast-icon {
    background-color: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.toast-error .toast-icon {
    background-color: rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.toast-warning .toast-icon {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.toast-info .toast-icon {
    background-color: rgba(6, 182, 212, 0.2);
    color: var(--info-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--text-primary);
}

.toast-message {
    color: var(--text-secondary);
    font-size: 13px;
}

.toast-close {
    color: var(--text-tertiary);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    margin-left: 12px;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Profile Select Styles */
.profile-select-wrapper {
    position: relative;
    width: 100%;
}

.profile-select-header {
    width: 100%;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed) ease;
    height: 36px;
}

.profile-select-header:hover {
    border-color: var(--primary-color);
}

.profile-select-header span:last-child {
    transition: transform var(--transition-speed) ease;
    color: var(--text-tertiary);
}

.profile-select-header.active span:last-child {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.profile-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.profile-option {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
}

.profile-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.profile-option.selected {
    background-color: rgba(59, 130, 246, 0.1);
}

.proxy-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #10B981;
    border-radius: 0 2px 2px 0;
}

.resale-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #EF4444;
    border-radius: 0 2px 2px 0;
    z-index: 2;
}

/* When both indicators are present, position them side by side */
.profile-option.has-proxy-indicator.has-resale-indicator .resale-indicator {
    left: 3px; /* Position red indicator next to green one */
    width: 3px;
}

/* Adjust padding for accounts with indicators */
.profile-option.has-proxy-indicator .profile-checkbox-container,
.profile-option.has-proxy-indicator .profile-text {
    padding-left: 6px;
}

.profile-option.has-resale-indicator .profile-checkbox-container,
.profile-option.has-resale-indicator .profile-text {
    padding-left: 6px;
}

/* When both indicators are present, add more padding */
.profile-option.has-proxy-indicator.has-resale-indicator .profile-checkbox-container,
.profile-option.has-proxy-indicator.has-resale-indicator .profile-text {
    padding-left: 9px; /* 3px + 3px + 3px spacing */
}

.profile-checkbox-container {
    margin-right: 8px;
    flex-shrink: 0;
}

.profile-checkbox-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.profile-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.profile-count {
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}

/* Recent URLs */
.url-input-wrapper {
    position: relative;
}

.recent-urls {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 150px;
    overflow-y: auto;
    z-index: 20;
    display: none;
    box-shadow: var(--shadow-md);
}

.recent-urls.show {
    display: block;
}

.recent-url-item {
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-speed) ease;
    border-bottom: 1px solid var(--border-color);
}

.recent-url-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.recent-url-item:last-child {
    border-bottom: none;
}

/* MFA Input */
.mfa-container {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    gap: 8px;
}

.mfa-input {
    width: 120px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 13px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    transition: all var(--transition-speed) ease;
    height: 28px;
}

.mfa-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.mfa-submit-btn {
    padding: 4px 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
    height: 28px;
}

.mfa-submit-btn:hover {
    background-color: var(--primary-hover);
}

.mfa-submit-btn:disabled {
    background-color: var(--text-tertiary);
    cursor: not-allowed;
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Task URL Column */
.task-url-td {
    width: 25px;
    white-space: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 200px;
}

.task-url-td::-webkit-scrollbar {
    display: none;
}

/* Table Column Widths */
#tasksTable {
    table-layout: fixed;
    width: 100%;
}

#tasksTable th:nth-child(1), 
#tasksTable td:nth-child(1) {
    width: 22%;
}

#tasksTable th:nth-child(2), 
#tasksTable td:nth-child(2) {
    width: 18%;
}

#tasksTable th:nth-child(3), 
#tasksTable td:nth-child(3) {
    width: 37%;
}

#tasksTable th:nth-child(4), 
#tasksTable td:nth-child(4) {
    width: 7.5%;
}

#tasksTable th:nth-child(5), 
#tasksTable td:nth-child(5) {
    width: 18%;
}

#tasksTable td:nth-child(1) {
    word-break: break-word;
    overflow: hidden;
}

#tasksTable td:nth-child(2) {
    word-break: break-word;
    white-space: nowrap;
}

#tasksTable td:nth-child(3) {
    font-size: 14px;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#tasksTable td:last-child {
    white-space: nowrap;
}

#tasksTable td:last-child .btn {
    margin-right: 6px;
    margin-bottom: 0;
}

#tasksTable td:last-child .btn:last-child {
    margin-right: 0;
}

.data-table td {
    vertical-align: middle;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-tertiary);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 14px;
    font-weight: 500;
}

/* Proxy Options */
.proxy-option {
    position: relative;
}

.proxy-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    white-space: nowrap;
    font-size: 12px;
    z-index: 1001;
    margin-left: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.proxy-option:hover .proxy-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Mobile-optimized tasks table */
.tasks-table-container {
    position: relative;
}

.logout-btn{
    padding: 8px 15px;
}

@media screen and (max-width: 768px) {
    #checkouts .card-body {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 15px !important;
    }
}

@media screen and (max-width: 480px) {
    #checkouts .card-body {
        padding: 10px !important;
        gap: 10px !important;
    }
}

/* Checkout card responsive design */
@media screen and (max-width: 768px) {
    .checkout-card {
        padding: 12px !important;
    }
    
    /* Keep horizontal layout but make seat map smaller */
    .checkout-card > div:last-child {
        gap: 12px !important;
    }
    
    /* Grid layout for mobile - stack grid items */
    .checkout-card > div:last-child > div:first-child > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    /* Smaller seat map but keep it on the right */
    .checkout-card > div:last-child > div:last-child {
        flex: 0 0 100px !important;
    }
    
    .checkout-card > div:last-child > div:last-child > div {
        padding: 6px !important;
    }
    
    .checkout-card > div:last-child > div:last-child img {
        max-height: 70px !important;
    }
}

@media screen and (max-width: 480px) {
    .checkout-card {
        padding: 10px !important;
    }
    
    .checkout-card h3 {
        font-size: 14px !important;
        margin-bottom: 2px !important;
    }
    
    .checkout-card > div:first-child {
        margin-bottom: 12px !important;
    }
    
    .checkout-card > div:last-child {
        gap: 8px !important;
    }
    
    /* Even smaller seat map on mobile but still on the right */
    .checkout-card > div:last-child > div:last-child {
        flex: 0 0 80px !important;
    }
    
    .checkout-card > div:last-child > div:last-child > div {
        padding: 4px !important;
    }
    
    .checkout-card > div:last-child > div:last-child img {
        max-height: 50px !important;
    }
    
    /* Make checkout button smaller on mobile */
    .checkout-card a {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
    .checkout-card a svg {
        width: 12px !important;
        height: 12px !important;
    }
}

/* Checkout card hover effects */
.checkout-card {
    transition: all 0.2s ease;
}

.checkout-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Delete button styling */
.delete-checkout-btn:hover {
    transform: scale(1.05);
}

/* Checkout button styling */
.checkout-card a:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


/* Responsive Design */
@media screen and (max-width: 1024px) {
    .dashboard-summary {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Adjust task table for tablets */
    #tasksTable th:nth-child(2), 
    #tasksTable td:nth-child(2) {
        width: 15%;
    }
    
    #tasksTable th:nth-child(3), 
    #tasksTable td:nth-child(3) {
        width: 40%;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --sidebar-width: 60px;
    }
    
    .logo h1, .logo-sub, .nav-item span {
        display: none;
    }
    
    .sidebar {
        padding: 15px 0;
    }
    
    .nav-item {
        justify-content: center;
        padding: 8px 0;
    }
    
    .nav-item svg {
        margin-right: 0;
    }
    
    .dashboard-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .card-header {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .card-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .proxy-tooltip {
        left: auto;
        right: 100%;
        margin-left: 0;
        margin-right: 8px;
    }
    
    /* Mobile tasks table optimizations */
    .table-responsive {
        border-radius: var(--border-radius);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #tasksTable {
        min-width: 600px;
    }
    
    /* Hide URL column on mobile */
    #tasksTable th:nth-child(2), 
    #tasksTable td:nth-child(2) {
        display: none;
    }
    
    /* Adjust remaining columns */
    #tasksTable th:nth-child(1), 
    #tasksTable td:nth-child(1) {
        width: 30%;
    }
    
    #tasksTable th:nth-child(3), 
    #tasksTable td:nth-child(3) {
        width: 35%;
        font-size: 12px;
    }
    
    #tasksTable th:nth-child(4), 
    #tasksTable td:nth-child(4) {
        width: 15%;
    }
    
    #tasksTable th:nth-child(5), 
    #tasksTable td:nth-child(5) {
        width: 20%;
    }
    
    /* Smaller buttons in table */
    #tasksTable .btn-small {
        padding: 3px 6px;
        font-size: 10px;
        height: 24px;
        margin-right: 3px;
    }
    
    /* Better MFA input on mobile */
    .mfa-container {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        margin-left: 0;
        margin-top: 8px;
    }
    
    .mfa-input {
        width: 100%;
        height: 32px;
        font-size: 14px;
    }
    
    .mfa-submit-btn {
        width: 100%;
        height: 32px;
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {

    .sg {
        display: block;
    }
    .sg > div {
        margin-bottom: 15px;
    }

    .dashboard-summary {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .action-grid {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100% !important;
    }
    
    .btn {
        font-size: 13px;
    }
    
    .btn-small {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Much improved card layout for tasks on mobile portrait */
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color, #e5e7eb);
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    #tasksTable {
        display: block;
        table-layout: auto !important;
        min-width: unset !important;
        width: 100% !important;
        border: none;
    }
    
    #tasksTable thead,
    #tasksTable tbody,
    #tasksTable th,
    #tasksTable td,
    #tasksTable tr {
        display: block;
        border: none;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    #tasksTable thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    /* Task card styling */
    #tasksTable tr {
        background-color: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        margin: 0 0 16px 0;
        padding: 16px;
        box-shadow: var(--shadow-sm);
        position: relative;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    #tasksTable tr:hover {
        background-color: var(--bg-tertiary);
    }
    
    /* Status badge positioning - move to top right corner */
    #tasksTable td:nth-child(4) {
        position: absolute;
        top: 16px;
        right: 16px;
        padding: 0;
        margin: 0;
        width: auto !important;
        max-width: 120px;
        text-align: right;
    }
    
    #tasksTable td:nth-child(4):before {
        display: none;
    }
    
    /* Account styling - emphasized */
    #tasksTable td:nth-child(1) {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 0 120px 12px 0;
        margin-bottom: 12px;
        font-weight: 600;
        font-size: 15px;
        color: var(--primary-color);
        width: 100% !important;
        max-width: 100% !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        box-sizing: border-box;
    }
    
    #tasksTable td:nth-child(1):before {
        position: static;
        display: block;
        width: 100%;
        padding: 0;
        margin-bottom: 4px;
        color: var(--text-tertiary);
        font-size: 12px;
        font-weight: 400;
    }
    
    /* URL styling */
    #tasksTable td:nth-child(2) {
        display: none; /* Hide URL on mobile as it's often too long */
    }
    
    /* Task status styling - most important content */
    #tasksTable td:nth-child(3) {
        padding: 0;
        margin-bottom: 16px;
        line-height: 1.5;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 12px;
        width: 100% !important;
        max-width: 100% !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
    }
    
    #tasksTable td:nth-child(3):before {
        position: static;
        display: block;
        width: 100%;
        padding: 0;
        margin-bottom: 4px;
        color: var(--text-tertiary);
        font-size: 12px;
        font-weight: 400;
    }
    
    /* Controls styling */
    #tasksTable td:last-child {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0;
        margin: 0;
        margin-top: 16px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    #tasksTable .btn-small {
        height: 36px !important;
        font-size: 13px;
        padding: 0 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 8px 0;
        box-sizing: border-box;
        min-width: 0;
    }
    
    #tasksTable .btn-small:last-child {
        margin-bottom: 0;
    }
    
    /* Status badge styling */
    #tasksTable .status-badge {
        padding: 6px 10px;
        font-size: 12px;
        font-weight: 600;
        border-radius: 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    /* Stack MFA controls vertically with better styling */
    .mfa-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin: 12px 0 0 0;
        background-color: rgba(59, 130, 246, 0.05);
        padding: 12px;
        border-radius: var(--border-radius);
        border: 1px solid rgba(59, 130, 246, 0.1);
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .mfa-input {
        width: 100% !important;
        max-width: 100% !important;
        height: 40px;
        font-size: 16px;
        letter-spacing: 2px;
        text-align: center;
        font-weight: 600;
        box-sizing: border-box;
        margin: 0;
    }
    
    .mfa-submit-btn {
        width: 100% !important;
        max-width: 100% !important;
        height: 40px;
        font-size: 14px;
        font-weight: 600;
        box-sizing: border-box;
        margin: 0;
    }
    
    /* Task status content */
    #tasksTable td:nth-child(3) {
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.4;
        hyphens: auto;
    }
    
    /* Empty state for mobile */
    .empty-message {
        text-align: center;
        padding: 30px 20px;
        font-size: 14px;
    }
    
    /* URL display when needed */
    .show-url-mobile #tasksTable td:nth-child(2) {
        display: block;
        padding: 0 0 12px 0;
        margin-bottom: 12px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-family: monospace;
        font-size: 12px;
        width: 100% !important;
        max-width: 100% !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        box-sizing: border-box;
    }
    
    .show-url-mobile #tasksTable td:nth-child(2):before {
        position: static;
        display: block;
        width: 100%;
        padding: 0;
        margin-bottom: 4px;
        color: var(--text-tertiary);
        font-size: 12px;
        font-weight: 400;
        white-space: normal;
    }
    
    /* Master toggle container adjustments for mobile */
    .master-toggle-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Account toggle container adjustments for mobile */
    .account-toggle-container {
        flex-wrap: nowrap;
        min-width: 0;
    }
    
    .account-toggle-container .toggle-label-text {
        font-size: 10px;
        min-width: 30px;
    }
}

/* Add data labels via JavaScript for mobile card layout */
.mobile-table-labels #tasksTable td:nth-child(1):before { content: "Account: "; }
.mobile-table-labels #tasksTable td:nth-child(2):before { content: "URL: "; }
.mobile-table-labels #tasksTable td:nth-child(3):before { content: "Status: "; }
.mobile-table-labels #tasksTable td:nth-child(4):before { content: "State: "; }
.mobile-table-labels #tasksTable td:nth-child(5):before { content: ""; }


a:visited { text-decoration: none; color:var(--text-primary); }
a:hover { text-decoration: none; color:var(--accent-color); }
a:focus { text-decoration: none; color:var(--text-primary); }
a:hover, a:active { text-decoration: none; color:var(--accent-color);}



.group-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.group-select {
    min-width: 140px;
    font-size: 13px;
}

.group-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.group-input-container .select-field {
    flex: 1;
}

/* New Group Form */
.new-group-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input {
    width: 40px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: none;
    cursor: pointer;
}

/* Groups List */
.groups-list {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-height: 300px;
    overflow-y: auto;
}

.group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.group-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.group-item:last-child {
    border-bottom: none;
}

.group-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.group-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.group-details h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.group-details p {
    margin: 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

.group-actions {
    display: flex;
    gap: 6px;
}

/* Group badge in task list */
.task-group-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    margin-left: 8px;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .group-controls {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .group-select {
        width: 100%;
    }
    
    .new-group-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .group-input-container {
        flex-direction: column;
        align-items: stretch;
    }
}

.editable-field-container {
    width: 100%;
}

.editable-field {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    transition: all 0.2s ease;
    min-width: 120px;
}

.editable-field:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-primary);
}

.editable-field:hover {
    border-color: var(--border-light);
    background-color: rgba(59, 130, 246, 0.02);
}

.password-field {
    font-family: monospace;
    letter-spacing: 1px;
}

.proxy-field {
    font-family: monospace;
    font-size: 13px;
}

.account-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.account-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    min-width: auto;
}

.account-actions .btn svg {
    margin-right: 2px;
}

.save-account-btn {
    background-color: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
    
}

.save-account-btn:hover {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.login-account-btn {
    background-color: var(--success-color) !important;
    color: white !important;
    border-color: var(--success-color) !important;
}

.login-account-btn:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
    
}

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

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .account-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .account-actions .btn {
        width: 100%;
        justify-content: center;
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .editable-field {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Update the accounts table header to accommodate new column */
#accountsTable th:nth-child(6), 
#accountsTable td:nth-child(6) {
    width: 180px;
    min-width: 180px;
}

@media screen and (max-width: 768px) {
    #accountsTable th:nth-child(6), 
    #accountsTable td:nth-child(6) {
        width: auto;
        min-width: 150px;
    }
}


.profile-group-header {
    font-weight: 600;
    font-size: 12px;
    padding: 8px 15px;
    margin-top: 8px;
    border-left: 3px solid;
    position: sticky;
    top: 0;
    z-index: 5;
}

/* Account table group column styles */
.account-group-column {
    min-width: 120px;
}

.account-group-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.account-group-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.account-group-change-btn {
    padding: 2px 6px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-group-change-btn:hover {
    background-color: var(--bg-quaternary);
    color: var(--text-primary);
}

/* Account Groups Management Modal */
.account-groups-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.account-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.account-group-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.account-group-item:last-child {
    border-bottom: none;
}

.account-group-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.account-group-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.account-group-details h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.account-group-details p {
    margin: 0;
    font-size: 12px;
    color: var(--text-tertiary);
}

.account-group-actions {
    display: flex;
    gap: 6px;
}

/* Account Group Filter in header */
.account-group-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 12px;
}

.account-group-select {
    min-width: 140px;
    font-size: 13px;
}

/* Account Assignment Modal */
.account-assignment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.account-assignment-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.account-assignment-field label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.account-assignment-readonly {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

/* Account Groups in Task Creation */
.profile-option.grouped {
    padding-left: 35px;
    position: relative;
}

.profile-option.grouped:before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 20px;
    background-color: var(--border-color);
}

/* Enhanced proxy validation styles */
.proxy-selection-required {
    border: 2px solid var(--warning-color) !important;
    background-color: rgba(245, 158, 11, 0.1) !important;
}

.proxy-selection-valid {
    border: 2px solid var(--success-color) !important;
    background-color: rgba(16, 185, 129, 0.1) !important;
}

/* Account Proxies default selection highlight */
.profile-option[data-value="Account"].default-selected {
    background-color: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success-color);
}

/* Mobile responsive adjustments for account groups */
@media screen and (max-width: 768px) {
    .account-group-controls {
        order: -1;
        width: 100%;
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .account-group-select {
        width: 100%;
    }
    
    .account-group-indicator {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .account-group-badge {
        font-size: 10px;
        padding: 1px 6px;
    }
    
    .profile-group-header {
        font-size: 11px;
        padding: 6px 12px;
    }
}

@media screen and (max-width: 480px) {
    .account-group-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .account-group-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .account-assignment-form {
        gap: 12px;
    }
}

/* Table column width adjustments for new Group column */
#accountsTable th:nth-child(6), 
#accountsTable td:nth-child(6) {
    width: 140px;
    min-width: 140px;
}

#accountsTable th:nth-child(7), 
#accountsTable td:nth-child(7) {
    width: 180px;
    min-width: 180px;
}

#accountsTable th:nth-child(8), 
#accountsTable td:nth-child(8) {
    width: 180px;
    min-width: 180px;
}

@media screen and (max-width: 768px) {
    #accountsTable th:nth-child(6), 
    #accountsTable td:nth-child(6) {
        width: auto;
        min-width: 120px;
    }
    
    #accountsTable th:nth-child(7), 
    #accountsTable td:nth-child(7) {
        width: auto;
        min-width: 150px;
    }
    
    #accountsTable th:nth-child(8), 
    #accountsTable td:nth-child(8) {
        width: auto;
        min-width: 150px;
    }
}

/* Enhanced task group badge styling for accounts dropdown */
.profile-option .task-group-badge {
    margin-left: auto;
    margin-right: 8px;
    font-size: 10px;
    padding: 1px 6px;
}

/* Group section dividers in dropdowns */
.profile-group-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 8px 0;
}

/* Improved account group color indicators */
.account-group-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* Default selection highlight for Account Proxies */
.profile-option[data-value="Account"] {
    background-color: rgba(16, 185, 129, 0.08);
    border-left: 3px solid var(--success-color);
}

.profile-option[data-value="Account"] .profile-text {
    font-weight: 600;
    color: var(--success-color);
}

/* Validation states for proxy dropdown */
.profile-select-wrapper.proxy-required .profile-select-header {
    border-color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.1);
}

.profile-select-wrapper.proxy-valid .profile-select-header {
    border-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.1);
}


.log-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.log-stats {
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 4px 8px;
    background-color: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* Log Console */
.log-console {
    background-color: #0a0a0a;
    color: #00ff00;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    height: 600px;
    overflow: hidden;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    position: relative;
}

.log-content {
    height: 100%;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: smooth;
}

/* Individual Log Entries */
.log-entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 4px;
    padding: 2px 0;
    border-radius: 2px;
    transition: background-color 0.2s ease;
    word-wrap: break-word;
    min-height: 18px;
}

.log-entry:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.log-entry.new-entry {
    animation: highlightNew 1s ease-out;
}

@keyframes highlightNew {
    0% {
        background-color: rgba(0, 255, 0, 0.2);
        transform: translateX(5px);
    }
    100% {
        background-color: transparent;
        transform: translateX(0);
    }
}

/* Log Entry Components */
.log-timestamp {
    color: #666666;
    font-size: 11px;
    width: 70px;
    flex-shrink: 0;
    margin-right: 8px;
    text-align: right;
}

.log-level {
    font-weight: 600;
    font-size: 11px;
    width: 60px;
    flex-shrink: 0;
    margin-right: 8px;
    text-align: center;
    border-radius: 3px;
    padding: 1px 4px;
}

.log-level.debug {
    color: #00aaff;
    background-color: rgba(0, 170, 255, 0.1);
}

.log-level.info {
    color: #00ff00;
    background-color: rgba(0, 255, 0, 0.1);
}

.log-level.warning {
    color: #ffaa00;
    background-color: rgba(255, 170, 0, 0.1);
}

.log-level.error {
    color: #ff4444;
    background-color: rgba(255, 68, 68, 0.1);
}

.log-level.success {
    color: #00ff88;
    background-color: rgba(0, 255, 138, 0.1);
}

.log-task {
    color: #888888;
    font-size: 11px;
    width: 120px;
    flex-shrink: 0;
    margin-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-message {
    color: #ffffff;
    flex: 1;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Special Message Styling */
.log-entry.system .log-message {
    color: #00aaff;
    font-weight: 500;
}

.log-entry.error .log-message {
    color: #ff6666;
}

.log-entry.success .log-message {
    color: #66ff66;
}

.log-entry.warning .log-message {
    color: #ffcc66;
}

/* Filtered Entries */
.log-entry.filtered {
    display: none;
}

/* Auto-scroll Indicator */
.autoscroll-active {
    position: relative;
}

.autoscroll-active::before {
    content: "●";
    position: absolute;
    top: 10px;
    right: 10px;
    color: #00ff00;
    font-size: 12px;
    animation: pulse 2s infinite;
    z-index: 1;
}

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

/* Search Highlighting */
.log-search-highlight {
    background-color: #ffff00;
    color: #000000;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: 600;
}

/* Scrollbar for log console */
.log-content::-webkit-scrollbar {
    width: 8px;
    display: block;
}

.log-content::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.log-content::-webkit-scrollbar-thumb {
    background: #444444;
    border-radius: 4px;
}

.log-content::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* Loading State */
.log-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-tertiary);
    font-style: italic;
}

.log-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* Empty State */
.log-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-tertiary);
    font-style: italic;
}

.log-empty svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Connection Status for Logs */
.log-connection-status {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 600;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: monospace;
    letter-spacing: 0.5px;
}

.log-connection-status.connected {
    border-color: rgba(0, 255, 0, 0.3);
    background-color: rgba(0, 255, 0, 0.1);
}

.log-connection-status.disconnected {
    border-color: rgba(255, 68, 68, 0.3);
    background-color: rgba(255, 68, 68, 0.1);
}

/* Ensure log console has relative positioning for absolute status */
.log-console {
    background-color: #0a0a0a;
    color: #00ff00;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.4;
    height: 600px;
    overflow: hidden;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    position: relative; /* This is important for absolute positioning of status */
}

/* Make sure the main connection status is not affected */
.connection-status {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.connection-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--danger-color);
    margin-right: 8px;
}

.connection-status.connected .status-dot {
    background-color: var(--success-color);
}

/* Responsive adjustments for log status */
@media screen and (max-width: 768px) {
    .log-connection-status {
        top: 8px;
        right: 8px;
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media screen and (max-width: 480px) {
    .log-connection-status {
        position: static;
        margin-bottom: 8px;
        text-align: center;
        border-radius: 4px;
    }
    
    .log-console {
        height: 300px;
    }
}

/* Button states for log controls */
.btn.autoscroll-enabled {
    background-color: var(--success-color) !important;
    color: white !important;
}

.btn.autoscroll-disabled {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-secondary) !important;
}


/* Add these styles to static/css/styles.css */

/* Presale Code Group Styling */
.presale-code-group-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.presale-code-group-badge {
    background-color: #9333EA;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.presale-codes-textarea {
    width: 100%;
    min-height: 300px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    height: auto;
    line-height: 1.5;
    box-sizing: border-box;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 15px;
    margin: 0;
    transition: all var(--transition-speed) ease;
}

.presale-codes-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--bg-tertiary);
}

.presale-codes-textarea::placeholder {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Presale Code Preview Styling */
#codePreview {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.1) 0%, rgba(147, 51, 234, 0.05) 100%);
    border-left: 3px solid #9333EA;
}

#codePreviewContent {
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

/* Presale Code Group Stats in Group Items */
.group-item .group-details small {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.8;
}

/* Enhanced group actions for presale codes */
.group-item .group-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.group-item .group-actions .btn-small {
    padding: 4px 8px;
    font-size: 11px;
    min-width: auto;
}

/* Warning color for reset button */
.btn-warning {
    background-color: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.btn-warning:hover {
    background-color: #D97706;
    border-color: #D97706;
}


#taskPresaleCodeGroupSelect option[value="none"] {
    color: var(--text-tertiary);
    font-style: italic;
}

/* Mobile responsive adjustments for presale code management */
@media screen and (max-width: 768px) {
    .presale-codes-textarea {
        min-height: 200px;
        font-size: 14px;
        padding: 12px;
    }
    
    .group-item .group-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .group-item .group-actions .btn-small {
        flex: 1;
        min-width: 70px;
        text-align: center;
    }
}

@media screen and (max-width: 480px) {
    .presale-codes-textarea {
        min-height: 150px;
        font-size: 13px;
        padding: 10px;
    }
    
    .group-item .group-actions {
        flex-direction: column;
        gap: 4px;
    }
    
    .group-item .group-actions .btn-small {
        width: 100%;
    }
    
    .new-group-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .new-group-form input[type="color"] {
        width: 100%;
        height: 40px;
    }
}