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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 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.1);
    overflow: hidden;
}

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

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    opacity: 0.9;
    font-size: 1.1em;
}

main {
    padding: 30px;
}

section {
    margin-bottom: 40px;
}

section h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Streamer Section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-add {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add:hover {
    background: #218838;
    transform: translateY(-1px);
}

.streamer-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.streamer-card {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.streamer-name {
    font-size: 1.5em;
    font-weight: 600;
    color: #667eea;
}

.streamer-details {
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 5px;
}

.btn-delete-streamer {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-delete-streamer:hover {
    background: #c82333;
    transform: scale(1.1);
}

.add-form {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.add-form h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-save {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-save:hover {
    background: #218838;
}

.btn-cancel {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel:hover {
    background: #5a6268;
}

.users-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.user-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.user-card.active {
    border-color: #28a745;
    background: #d4edda;
}

.user-card.inactive {
    border-color: #dc3545;
    background: #f8d7da;
}

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

.user-card h3 {
    font-size: 1.2em;
    margin: 0;
    color: #333;
}

.user-actions {
    margin: 12px 0;
}

.btn-start,
.btn-stop {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-start {
    background: #28a745;
    color: white;
}

.btn-start:hover {
    background: #218838;
    transform: translateY(-1px);
}

.btn-start-all {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-start-all:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-1px);
}

.btn-start-all:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-stop {
    background: #dc3545;
    color: white;
}

.btn-stop:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.user-status-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
}

.status-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.9em;
}

.status-label {
    color: #6c757d;
    font-weight: 500;
}

.status-value {
    color: #333;
    font-weight: 600;
}

.user-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.user-status.active {
    background: #28a745;
    color: white;
}

.user-status.inactive {
    background: #dc3545;
    color: white;
}

/* Message bulk input */
.message-bulk-input-container {
    background: #f8f9fa;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.bulk-input-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.bulk-message-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
    transition: border-color 0.3s;
}

.bulk-message-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-apply {
    padding: 10px 20px;
    background: #17a2b8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-apply:hover {
    background: #138496;
}

/* Message table */
.message-table-container {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
}

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

.message-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.message-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
}

.message-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

.message-table tbody tr:hover {
    background: #f8f9fa;
}

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

.user-cell {
    min-width: 150px;
}

.user-cell strong {
    display: block;
    margin-bottom: 4px;
    color: #333;
}

.user-id {
    font-size: 0.85em;
    color: #6c757d;
}

.status-cell {
    min-width: 100px;
}

.message-cell {
    width: 100%;
}

.message-input-row {
    width: 100%;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s;
}

.message-input-row:focus {
    outline: none;
    border-color: #667eea;
}

.action-cell {
    min-width: 120px;
    text-align: center;
}

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

.btn-send-row:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

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

.btn-send-row:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-send-all {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.btn-send-all:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-1px);
}

.btn-send-all:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.message-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
    display: none;
}

.message-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.history-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.refresh-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.3s;
}

.refresh-btn:hover {
    background: #5a6268;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    background: #f8f9fa;
}

.history-item {
    background: white;
    border-left: 4px solid #667eea;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-item.success {
    border-left-color: #28a745;
}

.history-item.error {
    border-left-color: #dc3545;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-item-username {
    font-weight: 600;
    color: #667eea;
}

.history-item-time {
    font-size: 0.85em;
    color: #6c757d;
}

.history-item-message {
    margin-bottom: 5px;
    color: #333;
}

.history-item-error {
    font-size: 0.9em;
    color: #dc3545;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
}

.empty {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* Scrollbar styling */
.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

