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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    font-weight: 600;
}

main {
    padding: 30px;
}

section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
}

/* Radio buttons */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

.radio-label input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

/* Input groups */
.input-group {
    margin-bottom: 15px;
    flex: 1;
    min-width: 200px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.input-group input[type="text"]:focus,
.input-group input[type="number"]:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
}

/* File upload */
.file-upload {
    margin-top: 15px;
}

.file-label {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}

.file-label:hover {
    background: #5568d3;
}

.file-label input[type="file"] {
    display: none;
}

/* Numbers display */
.numbers-display {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
}

.numbers-display:empty {
    display: none;
}

.number-badge {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background: #667eea;
    color: white;
    border-radius: 20px;
    font-size: 13px;
}

/* Info text */
.info-text {
    padding: 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
}

/* Input row for side-by-side layout */
.input-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.input-row .input-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.input-row .input-group input[type="number"] {
    width: 100%;
    max-width: 200px;
}

@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
    }
    
    .input-row .input-group {
        min-width: 100%;
    }
    
    .input-row .input-group input[type="number"] {
        max-width: 100%;
    }
}

/* Text options */
.text-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* API options */
.api-options {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.config-group {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 6px;
}

/* Send button */
.action-section {
    text-align: center;
}

.send-btn {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

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

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.stop-btn {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-left: 15px;
}

.stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(220, 53, 69, 0.4);
}

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

.stop-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.progress-info {
    margin-top: 15px;
    font-weight: 500;
    color: #667eea;
}

/* Table controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

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

.clear-btn {
    padding: 8px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

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

/* Table */
.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: 6px;
}

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

thead {
    background: #667eea;
    color: white;
}

thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
    background: #f8f9fa;
}

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

.status-ok {
    color: #fff;
    background-color: #28a745;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-error {
    color: #dc3545;
    font-weight: 600;
}

.status-pending {
    color: #ffc107;
    font-weight: 600;
}

.status-busy {
    color: #ff6b6b;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.page-btn {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: #5568d3;
}

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

#pageInfo {
    font-weight: 500;
    color: #555;
}

/* Responsive */
@media (max-width: 768px) {
    main {
        padding: 15px;
    }

    section {
        padding: 15px;
    }

    .radio-group,
    .text-options,
    .api-options {
        flex-direction: column;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-direction: column;
    }

    .send-btn {
        width: 100%;
    }
}
