:root {
    --primary-color: #25d366;
    --secondary-color: #128c7e;
    --dark-color: #075e54;
    --light-color: #dcf8c6;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --success-color: #198754;
}

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.navbar-brand {
    font-weight: 600;
}

.tab-content {
    display: none;
}

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

.list-group-item.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.list-group-item:hover {
    background-color: rgba(37, 211, 102, 0.1);
}

.account-card {
    transition: transform 0.2s ease-in-out;
    border-left: 4px solid var(--primary-color);
}

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

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-ready {
    background-color: var(--success-color);
    animation: pulse 2s infinite;
}

.status-connecting {
    background-color: var(--warning-color);
    animation: blink 1s infinite;
}

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

.status-qr_generated {
    background-color: #6f42c1;
    animation: blink 1s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.3;
    }
}

.chat-message {
    border-left: 3px solid var(--primary-color);
    background-color: white;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chat-message.from-me {
    border-left-color: var(--secondary-color);
    background-color: var(--light-color);
    margin-left: 20px;
}

.chat-message.from-them {
    border-left-color: var(--primary-color);
    background-color: white;
    margin-right: 20px;
}

.chat-timestamp {
    font-size: 0.8em;
    color: #6c757d;
}

.keyword-status-badge {
    font-size: 0.75em;
}

.queue-item {
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 8px;
}

.queue-item.queued {
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 4px solid #0d6efd;
}

.queue-item.processing {
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
}

.queue-item.sent {
    background-color: rgba(25, 135, 84, 0.1);
    border-left: 4px solid #198754;
}

.queue-item.failed {
    background-color: rgba(220, 53, 69, 0.1);
    border-left: 4px solid #dc3545;
}

.qr-code-container {
    padding: 20px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: inline-block;
}

.qr-code-container img {
    max-width: 100%;
    height: auto;
}

.connection-status {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    background-color: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

.connection-status.connected {
    background-color: rgba(25, 135, 84, 0.9);
}

.connection-status.disconnected {
    background-color: rgba(220, 53, 69, 0.9);
}

.stats-card {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stats-card small {
    font-size: 0.9rem;
    opacity: 0.9;
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    border-top: none;
    background-color: #f8f9fa;
    font-weight: 600;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.modal-content {
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .account-card {
        margin-bottom: 15px;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #ffffff;
    }
    
    .card {
        background-color: #1e1e1e;
        border-color: #333;
    }
    
    .table {
        --bs-table-bg: #1e1e1e;
        --bs-table-color: #ffffff;
    }
    
    .modal-content {
        background-color: #1e1e1e;
        color: #ffffff;
    }
}