/* 
 * Datafile Scraper Design System (Minimalist & Professional)
 * Font: Poppins (Google Fonts)
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    /* Colors */
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --primary: #2563eb;
    /* Modern Blue */
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --neutral-border: #e2e8f0;
    --console-bg: #1e1e2e;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    padding: var(--spacing-lg);
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

header {
    text-align: center;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 2rem;
    letter-spacing: -0.5px;
}

/* Components */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--neutral-border);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

textarea {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.controls {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--neutral-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

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

/* Logs */
.log-window {
    background: var(--console-bg);
    color: #e0e0e0;
    border-radius: var(--radius-md);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
    height: 250px;
    overflow-y: auto;
    padding: var(--spacing-sm);
    border: 1px solid #333;
}

.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.status-badge {
    font-weight: 600;
    color: var(--primary);
}

/* Forms */
.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--bg-card);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    transform: translateY(-20px);
    transition: transform 0.3s;
    border: 1px solid var(--neutral-border);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    color: var(--danger);
}

/* Logs Hidden State */
.logs-hidden .log-window {
    display: none;
}

/* Data Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--spacing-sm);
}

th {
    text-align: left;
    padding: 1rem;
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--neutral-border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--neutral-border);
    color: var(--text-primary);
}

tr:hover {
    background-color: #f8fafc;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}