* {
    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, #1e1e2e 0%, #2d2d44 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
    padding-top: 90px; /* Space for fixed global control bar */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Global Control Bar - Always visible at top */
.global-control-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(17, 24, 39, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(239, 68, 68, 0.3);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.global-status {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.global-status span {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.status-idle {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-info {
    color: #60a5fa;
    font-size: 13px;
    background: rgba(96, 165, 250, 0.1);
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-danger-global {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-danger-global:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.6);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-danger-global:active {
    transform: translateY(0);
}

.btn-danger-global:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

header p {
    color: #9ca3af;
    font-size: 1.1em;
}

.input-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.input-section label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #60a5fa;
}

#urls {
    width: 100%;
    padding: 15px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    margin-bottom: 20px;
}

#urls:focus {
    outline: none;
    border-color: #60a5fa;
}

.button-group {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.progress-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.progress-section h2 {
    margin-bottom: 20px;
    color: #60a5fa;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #1a1a2e;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa 0%, #3b82f6 100%);
    transition: width 0.5s ease;
    width: 0%;
}

#progressText {
    text-align: center;
    color: #9ca3af;
    font-weight: 600;
}

.results-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.results-header h2 {
    color: #60a5fa;
}

.table-container {
    overflow-x: auto;
}

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

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

th {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    font-weight: 600;
    position: sticky;
    top: 0;
}

td {
    color: #e0e0e0;
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.status-success {
    color: #34d399;
}

.status-error {
    color: #f87171;
}

.status-processing {
    color: #fbbf24;
}

.keywords-cell {
    max-width: 600px;
}

.keyword-chip {
    display: inline-block;
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    padding: 4px 8px;
    border-radius: 4px;
    margin: 2px;
    font-size: 12px;
}

.mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: white;
    border-color: transparent;
}

.mode-content {
    animation: fadeIn 0.3s ease;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #60a5fa;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group textarea {
    font-family: 'Courier New', monospace;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #60a5fa;
}

.search-results-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 30px;
}

.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-box h2 {
    color: #60a5fa;
    margin-bottom: 30px;
    font-size: 1.8em;
}

.login-box input[type="password"] {
    width: 100%;
    padding: 15px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.login-box input[type="password"]:focus {
    outline: none;
    border-color: #60a5fa;
}

.login-box .btn {
    width: 100%;
}

.error-message {
    color: #f87171;
    margin-top: 15px;
    font-size: 14px;
}
