:root {
    --primary-color: #2196F3;
    --error-color: #f44336;
    --success-color: #4CAF50;
    --text-color: #333;
    --background-color: #f5f5f5;
    --font-family: Arial, sans-serif;
    --monospace-font: 'Consolas', 'Monaco', 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo-container {
    flex: 0 0 auto;
}

.logo {
    height: 60px;
    width: auto;
}

.main-title {
    flex: 1;
    text-align: center;
    font-size: 24px;
    margin: 0 20px;
}

/* Admin controls */
.admin-controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}

/* Cards Container for side-by-side layout */
.cards-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    height: fit-content;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    margin-bottom: 10px;
}

select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' 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 8px center;
    background-size: 16px;
    padding-right: 32px;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

select option {
    padding: 8px;
    font-size: 14px;
    background-color: white;
    color: var(--text-color);
}

/* Button styles */
.button,
.save-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 150px;
    text-align: center;
    font-weight: 500;
}

.button:hover,
.save-btn:hover {
    background-color: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button.secondary {
    background-color: #757575;
}

.button.secondary:hover {
    background-color: #616161;
}

.button.active {
    background-color: var(--error-color);
}

.button.active:hover {
    background-color: #d32f2f;
}

/* Process Controls */
.process-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.process-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.process-group.continuous {
    padding-top: 20px;
    border-top: 1px dashed #ddd;
}

.interval-select {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Admin page specific styles */
.config-section {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.config-section h3 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 16px;
}

.config-form {
    width: 100%;
}

/* Token section styles */
.token-section {
    margin-top: 20px;
}

.saved-tokens {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.saved-tokens h3 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 16px;
}

.token-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.token-info {
    flex: 1;
}

.token-info strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
}

.token-details {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

.token-details div {
    margin-bottom: 4px;
}

.token-actions {
    display: flex;
    gap: 10px;
    margin-left: 15px;
}

.delete-btn {
    padding: 6px 12px;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.delete-btn:hover {
    background-color: #d32f2f;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    background-color: #333;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background-color: var(--success-color);
}

.toast.error {
    background-color: var(--error-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Status info styles */
.status-info {
    display: grid;
    gap: 10px;
}

.status-info p {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
}

.status-info span {
    color: #666;
    font-size: 13px;
    word-break: break-all;
}

/* Card headings */
.card h2 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-size: 18px;
}

/* Next run countdown */
#nextRun {
    font-weight: bold;
    color: var(--primary-color);
}

#nextRun.active {
    color: var(--success-color);
}

/* Status styles */
.status-section {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #757575;
}

.status-dot.connected {
    background-color: var(--success-color);
}

.status-dot.error {
    background-color: var(--error-color);
}

/* Logs section */
.logs-section {
    margin-top: 20px;
}

.logs-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.logs-container {
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-family: var(--monospace-font);
    font-size: 12px;
    line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
    }

    .data-source-card {
        max-width: none;
    }

    .config-form {
        max-width: none;
    }

    .interval-select {
        flex-direction: column;
        align-items: stretch;
    }

    .interval-select label {
        margin-bottom: 8px;
    }
}
