:root {
    --primary-color: #0066b3;
    --secondary-color: #2196F3;
    --error-color: #f44336;
    --success-color: #4CAF50;
    --background-color: #f0f5fa;
    --text-color: #333;
    --border-color: #ddd;
    --card-shadow: 0 2px 4px rgba(0, 102, 179, 0.1);
}

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

body {
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    display: flex;
    margin: 0;
    min-height: 100vh;
}

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

/* Dashboard Header */
header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    object-position: left center;
}

/* Ensure SVG colors match theme */
.logo svg path {
    fill: var(--primary-color);
}

header h1 {
    color: var(--primary-color);
    font-size: 2em;
    font-weight: 500;
}

/* Control Panel Card */
.control-panel {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
}

.date-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.date-input {
    position: relative;
}

.date-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #666;
}

.date-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.date-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* Button Styling */
.button-group {
    display: flex;
    gap: 15px;
}

.button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

.button.secondary {
    background-color: var(--secondary-color);
    color: white;
}

.button.clear {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
    font-size: 12px;
    transition: all 0.2s ease;
}

.button.clear:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.button.clear i {
    font-size: 14px;
    margin-right: 4px;
}

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

.button.danger:hover {
    background-color: #d32f2f;
}

/* Add loading state for buttons */
.button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Output Terminal Card */
.output-container {
    background: #1e1e1e;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    position: relative;
}

.output-header {
    padding: 15px 20px;
    background-color: #2d2d2d;
    border-bottom: 1px solid #3d3d3d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.output-header h3 {
    color: #fff;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

#output {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    font-family: "Century Gothic", CenturyGothic, AppleGothic, monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #fff;
    background-color: #1e1e1e;
    scroll-behavior: smooth;
}

.output-entry {
    margin-bottom: 2px;
    padding: 2px 8px;
    border-radius: 4px;
}

.output-entry pre {
    margin: 0;
    white-space: pre-wrap;
    color: #a9b7c6;
}

.output-entry.summary {
    background-color: #2c3e50;
    border-left: 4px solid #3498db;
    margin: 8px 0;
    padding: 12px;
}

.output-entry.summary pre {
    color: #ecf0f1;
    font-weight: 500;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.output-entry.error {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid var(--error-color);
}

/* Add these styles for rate limit error */
.output-entry.rate-limit {
    background-color: rgba(244, 67, 54, 0.1);
    border-left: 4px solid #f44336;
    color: #f44336;
    padding: 8px;
    margin: 4px 0;
}

/* Scrollbar for Terminal */
#output::-webkit-scrollbar {
    width: 10px;
}

#output::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

#output::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
    border: 2px solid #2d2d2d;
}

#output::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: white;
    padding: 4px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.tab-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background-color: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    position: relative;
    border-radius: 6px;
}

.tab-button:hover {
    color: var(--primary-color);
    background-color: #f8fafc;
}

.tab-button.active {
    background-color: #e6f3ff;
    color: var(--primary-color);
    font-weight: 600;
}

.tab-button i {
    font-size: 16px;
}

/* Add subtle animation for tab switch */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Add a subtle border between tabs */
.tab-button:not(:last-child) {
    border-right: 1px solid #f1f5f9;
}

/* Add hover effect */
.tab-button:hover {
    background-color: #f8fafc;
}

/* Active tab indicator */
.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Table Styles */
.extractions-panel {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

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

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

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

th {
    background-color: #f8f9fa;
    font-weight: 500;
    color: #666;
}

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

.action-buttons {
    display: flex;
    gap: 8px;
}

.action-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-button.download {
    background-color: var(--secondary-color);
    color: white;
}

/* Add the cancelled message style */
.output-entry.cancelled {
    background-color: rgba(244, 67, 54, 0.15);
    border-left: 4px solid #d32f2f;
    color: #d32f2f;
    font-weight: 500;
    padding: 12px;
    margin: 8px 0;
}

.output-entry.cancelled pre {
    color: #d32f2f;
    font-weight: 500;
}

/* Add divider style */
.output-divider {
    border-top: 2px solid #3d3d3d;
    margin: 15px 0;
}

/* Add new generation message style */
.output-entry.new-generation {
    background-color: rgba(33, 150, 243, 0.15);
    border-left: 4px solid #2196F3;
    color: #2196F3;
    font-weight: 500;
    padding: 12px;
    margin: 8px 0;
}

.output-entry.new-generation pre {
    color: #2196F3;
    font-weight: 500;
}

/* Update button colors */
.button.primary {
    background-color: var(--primary-color);
    color: white;
}

.button.primary:hover {
    background-color: #0055a3;
}

/* Empty state styling */
.empty-state {
    display: none;  /* Hidden by default, shown via JavaScript */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
}

.empty-state i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 16px;
    opacity: 0.7;
}

.empty-state p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #475569;
}

.empty-state span {
    font-size: 14px;
    color: #94a3b8;
}

/* Show empty state when table is empty */
.table-container:empty + .empty-state,
.table-container table:not(:has(tbody tr)) + .empty-state {
    display: flex;
}

.output-entry.success {
    background-color: rgba(76, 175, 80, 0.15);
    border-left: 4px solid var(--success-color);
    color: var(--success-color);
    font-weight: 600;
    padding: 12px;
    margin: 8px 0;
}

.output-entry.success pre {
    color: var(--success-color);
    font-weight: 600;
}

.header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.version-badge {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
}

.live-clock {
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
}

.live-clock::before {
    content: '\f017';
    font-family: 'Font Awesome 5 Free';
    font-weight: 400;
    color: var(--primary-color);
}

.sidebar {
    width: 320px;
    min-width: 320px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    height: 40px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-family: "Century Gothic", CenturyGothic, AppleGothic, sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background-color: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
    text-decoration: none;
}

.nav-button:hover {
    color: var(--primary-color);
    background-color: #f8fafc;
}

.nav-button.active {
    background-color: #e6f3ff;
    color: var(--primary-color);
    font-weight: 600;
}

.nav-button i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.main-content {
    margin-left: 320px;
    padding: 20px;
    flex: 1;
}

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

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background-color: var(--background-color);
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: #f59e0b;
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-color);
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.close-button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    background-color: var(--border-color);
}

.button.secondary {
    background-color: var(--border-color);
    color: var(--text-color);
}

.button.secondary:hover {
    background-color: var(--hover-color);
}

/* Wiki page styles */
.wiki-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.wiki-section {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wiki-section h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.instruction-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.step {
    position: relative;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.step-number {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.step h3 {
    margin-top: 0.5rem;
    color: var(--primary-color);
}

.troubleshooting {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.issue {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--warning-color);
}

.issue h3 {
    color: var(--warning-color);
    margin-bottom: 1rem;
}

.issue ul {
    list-style-type: none;
    padding: 0;
}

.issue li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.issue li:before {
    content: "•";
    color: var(--warning-color);
    position: absolute;
    left: 0;
}

.resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.resource-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.resource-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* README styles */
.readme-content {
    color: var(--text-color);
    line-height: 1.6;
}

.readme-content h1,
.readme-content h2,
.readme-content h3 {
    color: var(--primary-color);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.readme-content h1 {
    font-size: 2em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3em;
}

.readme-content h2 {
    font-size: 1.5em;
}

.readme-content h3 {
    font-size: 1.2em;
}

.readme-content code {
    background: var(--bg-secondary);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
}

.readme-content pre {
    background: var(--bg-secondary);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1em 0;
}

.readme-content ul,
.readme-content ol {
    padding-left: 2em;
    margin: 1em 0;
}

.readme-content li {
    margin: 0.5em 0;
}

.readme-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.readme-content a:hover {
    text-decoration: underline;
}

.readme-content blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 1em 0;
    padding-left: 1em;
    color: var(--text-secondary);
}

/* Navigation submenu styles */
.nav-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    display: flex;
    flex-direction: column;
}

.nav-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.nav-header:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.nav-header i:last-child {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.nav-header.expanded i:last-child {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding-left: 20px;
}

.nav-submenu.expanded {
    display: flex;
}

.nav-submenu .nav-button {
    padding: 10px 16px;
}