body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    flex-direction: column;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 40px;
    height: 40px;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 1px;
    color: var(--text-primary);
}

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

button {
    padding: 8px 16px;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

button:hover {
    background-color: var(--btn-bg-hover);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

button:active {
    transform: scale(0.98);
}

.refresh-btn {
    color: #4fc3f7;
    border-color: #03a9f4;
}

.start-btn {
    color: #81c784;
    border-color: #4caf50;
}

.stop-btn {
    color: #e57373;
    border-color: #f44336;
}

.domains-btn {
    color: #ffb74d;
    border-color: #ff9800;
    font-size: 18px;
    padding: 8px 12px;
}

.settings-btn {
    color: var(--text-primary);
    border-color: #666;
    font-size: 18px;
    padding: 8px 12px;
}

.domain-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    width: 100%;
}

@media (max-width: 1400px) {
    .domain-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .domain-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 800px) {
    .domain-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .domain-list {
        grid-template-columns: 1fr;
    }
}

.domain-row {
    display: flex;
    align-items: center;
    padding: 7px 10px;
    /* Extra compact */
    background-color: var(--bg-card);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 0.78em;
    /* Smaller font for 5 columns */
}

.domain-row.active {
    background-color: var(--bg-active);
    border-color: var(--border-active);
    border-width: 2px;
    transform: scale(1.02);
    box-shadow: 0 0 15px var(--accent-glow), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #333;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
    margin-right: 12px;
    flex-shrink: 0;
    border: 1px solid #111;
}

.led.grey {
    background-color: #444;
    box-shadow: none;
}

.led.green {
    background-color: #00ff00;
    box-shadow: 0 0 6px #00ff00, 0 0 10px #00ff00, inset 0 0 3px rgba(255, 255, 255, 0.5);
}

.led.red {
    background-color: #ff0000;
    box-shadow: 0 0 6px #ff0000, 0 0 10px #ff0000, inset 0 0 3px rgba(255, 255, 255, 0.5);
}

.led.amber {
    background-color: #ffbf00;
    box-shadow: 0 0 6px #ffbf00, 0 0 10px #ffbf00, inset 0 0 3px rgba(255, 255, 255, 0.5);
}

.led.blue {
    background-color: #2196f3;
    box-shadow: 0 0 6px #2196f3, 0 0 10px #2196f3, inset 0 0 3px rgba(255, 255, 255, 0.5);
}

.domain-name {
    flex-grow: 1;
    font-size: 0.95em;
    letter-spacing: 0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
}

.domain-link {
    color: var(--text-primary);
    text-decoration: none;
}

.domain-link:hover {
    text-decoration: underline;
    color: var(--text-primary);
    opacity: 0.9;
}

.status-text {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.75em;
    color: var(--text-muted);
    min-width: 70px;
    text-align: right;
    white-space: nowrap;
}

.status-text.ok {
    color: #00ff00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}

.status-text.error {
    color: #ff0000;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.status-text.loading {
    color: #ffbf00;
    text-shadow: 0 0 5px rgba(255, 191, 0, 0.3);
}

.status-text.ignore {
    color: #2196f3;
    text-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

/* Input Controls */
.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 20px;
}

input[type="text"],
select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--accent-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-modal-overlay);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.2s ease-in;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    animation: slideIn 0.3s ease-out;
}

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

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

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
}

.close-btn {
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

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

.modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.modal-instructions {
    color: var(--text-secondary);
    margin: 0 0 15px 0;
    font-size: 0.9em;
}

.setting-item {
    margin-bottom: 25px;
}

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

.setting-item input[type="number"],
.setting-item select {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    border-radius: 5px;
    font-size: 14px;
}

.setting-item input[type="number"]:focus,
.setting-item select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.current-value {
    display: inline-block;
    margin-left: 15px;
    color: var(--accent-color);
    font-weight: 500;
}

#domainsTextarea {
    width: 100%;
    padding: 15px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-input);
    color: var(--text-primary);
    border-radius: 5px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    resize: vertical;
    line-height: 1.6;
}

#domainsTextarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

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

.save-btn,
.cancel-btn {
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.save-btn {
    background-color: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

.save-btn:hover {
    background-color: #45a049;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.cancel-btn {
    background-color: var(--btn-bg);
    color: var(--btn-text);
}

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

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.3s ease-out forwards;
    opacity: 0;
    /* Start hidden for animation */
}

.toast.show {
    opacity: 1;
}

.toast.hide {
    animation: fadeOutRight 0.3s ease-in forwards;
}

.toast.success {
    border-left-color: #4caf50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.info {
    border-left-color: #2196f3;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Header Stats */
.header-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    display: flex;
    align-items: center;
    font-size: 0.85em;
    color: var(--text-secondary);
    font-weight: 600;
    font-family: 'Consolas', monospace;
}

.stat-item .led {
    margin-right: 5px;
    width: 7px;
    height: 7px;
}

.stat-item .icon {
    margin-right: 5px;
    font-size: 1.1em;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.stat-item.total {
    margin-left: 2px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 800px) {
    .header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .brand {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    .header-stats {
        margin: 5px 0;
        width: fit-content;
        padding: 6px 15px;
    }

    .controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .filter-group {
        margin-right: 0;
        width: 100%;
    }

    #searchInput {
        width: 100%;
    }
}