/* styles.css */
/* WebView2 Worker Testing Sample Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
}

header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

.worker-section {
    background-color: white;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.worker-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    font-size: 1.5em;
}

.worker-section h3 {
    color: #34495e;
    margin-bottom: 10px;
    margin-top: 20px;
    font-size: 1.2em;
}

.controls {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.message-section {
    margin-bottom: 20px;
}

.section {
    background-color: white;
    margin-bottom: 20px;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
    font-size: 1.5em;
}

.message-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.message-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.message-input:focus {
    outline: none;
    border-color: #3498db;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7f8c8d;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c0392b;
}

.output-section {
    margin-top: 20px;
}

.output-box {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #34495e;
}

.message {
    margin-bottom: 5px;
    padding: 2px 0;
    word-wrap: break-word;
}

.message-info {
    color: #3498db;
}

.message-success {
    color: #2ecc71;
}

.message-error {
    color: #e74c3c;
}

.message-sent {
    color: #f39c12;
}

.message-received {
    color: #9b59b6;
}

.message-broadcast {
    color: #1abc9c;
}

.message-iframe {
    color: #e67e22;
}

.timestamp {
    color: #7f8c8d;
    font-size: 11px;
}

.status-box {
    background-color: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.status-box p {
    margin-bottom: 8px;
}

.status-box p:last-child {
    margin-bottom: 0;
}

.status-active {
    color: #27ae60;
    font-weight: bold;
}

.status-inactive {
    color: #e74c3c;
    font-weight: bold;
}

.iframe-container {
    margin: 15px 0;
    border-radius: 4px;
    overflow: hidden;
}

#workerIframe {
    width: 100%;
    height: 200px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2em;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

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

    .message-input {
        min-width: auto;
        margin-bottom: 10px;
    }

    .worker-section {
        padding: 15px;
    }
}

/* Scrollbar styling for webkit browsers */
.output-box::-webkit-scrollbar {
    width: 8px;
}

.output-box::-webkit-scrollbar-track {
    background: #34495e;
}

.output-box::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

.output-box::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Animation for message appearance */
.message {
    animation: fadeIn 0.3s ease-in;
}

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

/* Hover effects */
.worker-section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}

/* Focus states for accessibility */
.btn:focus,
.message-input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}