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

body {
    font-family: 'JetBrains Mono', monospace, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #1c1c1e;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.container {
    background: #1c1c1e;
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    min-width: 500px;  /* Add this line - prevents container from getting too narrow */
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1),
                0 20px 40px rgba(0, 0, 0, 0.5);
    margin-top: 150px;
}

h1 {
    color: #f1a013;
    text-align: center;
    margin-bottom: 32px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

h2 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
}

.section {
    background: #2c2c2e;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
}

.section-note {
    color: #9ca3af;
    font-size: 14px;
    margin-bottom: 12px;
    font-weight: 300;
}

/* File input style like sample app */
.file-input {
    position: relative;
    margin-bottom: 24px;
}
.file-input input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.file-input label {
    display: block;
    background: #2c2c2e;
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    border: 1px solid #1d4ed8;
    font-size: 14px;
    font-weight: 500;
}
.file-input label:hover {
    background: #3a3a3c;
}
.file-input.selected label {
    background: #1d4ed8;
    border-color: #1d4ed8;
}
.filename {
    font-size: 18px !important; /* Try a bigger change to see if it works */
    color: #9ca3af;
    margin-top: 4px;
    text-align: center;
    font-weight: 600 !important;
}

/* Buttons */
button, .export-btn {
    background: #2c2c2e;
    color: white;
    border: 1px solid #1d4ed8;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 400;
    font-family: 'JetBrains Mono', monospace;  /* Add this line */
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 10px 0;    
}
button:hover:not(:disabled), .export-btn:hover {
    background: #3a3a3c;
}
button:disabled {
    background: #2c2c2e;
    color: #6b7280;
    border-color: #4b5563;
    cursor: not-allowed;
    opacity: 0.6;
}
.export-btn {
    display: inline-block;
    text-decoration: none;
    margin-top: 12px;
}

.logo {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px auto;
    display: block;
}

/* Status messages */
.status {
    margin-top: 6px;
    font-size: 14px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.status.show { opacity: 1; }
.status.success { color: #34d399; }
.status.error { color: #f87171; }
.status.info { color: #60a5fa; }

/* Summary cards */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 24px;
}
.summary-card {
    background: #2c2c2e;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}
.summary-number {
    font-size: 22px;
    font-weight: bold;
    color: #60a5fa;
}
.summary-label {
    font-size: 14px;
    color: #d1d5db;
}

/* Funnel, comparisons, opportunities */
.funnel-item, .comparison-item, .opportunity-item {
    background: #2c2c2e;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}
.query-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
    color: #ffffff;
}
.funnel-flow {
    font-family: monospace;
    color: #34d399;
    font-size: 14px;
    margin-top: 8px;
}
.funnel-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}
.stat-box {
    background: #1c1c1e;
    border: 1px solid #3a3a3c;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}
.stat-number {
    font-weight: 600;
    font-size: 16px;
    color: #60a5fa;
}
.stat-label {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
    text-transform: uppercase;
}
.badge-success { background: #064e3b; color: #34d399; border: 1px solid #34d399; }
.badge-warning { background: #78350f; color: #fbbf24; border: 1px solid #fbbf24; }
.badge-danger { background: #7f1d1d; color: #f87171; border: 1px solid #f87171; }
.badge-info { background: #1e3a8a; color: #60a5fa; border: 1px solid #60a5fa; }

/* Loader */
.loader {
    display: none;
    margin: 20px auto;
    width: 32px;
    height: 32px;
    border: 3px solid #4b5563;
    border-top: 3px solid #1d4ed8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table Page Styles */
.table-page {
    display: none;
}

.table-page-wrapper {
    padding: 20px;
    min-height: 100vh;
    background: #1c1c1e;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #2c2c2e;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    padding: 20px;
}

.table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-summary {
    display: flex;
    gap: 20px;
}

.summary-item {
    text-align: center;
}

.summary-value {
    font-size: 18px;
    font-weight: bold;
    color: #60a5fa;
}

.summary-description {
    font-size: 12px;
    color: #d1d5db;
}

.export-button {
    border: 1px solid #059669;
}

.table-container {
    background: #2c2c2e;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    overflow: auto;
    max-height: 70vh;
}

.results-table {
    width: 900px;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #3a3a3c;
    white-space: nowrap;
    font-size: 14px;
}

.results-table th {
    background: #1c1c1e;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.results-table tr:hover {
    background: #3a3a3c;
}

.results-table input,
.results-table select {
    background: #1c1c1e;
    color: #ffffff;
    border: 1px solid #3a3a3c;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;  /* Add this line */
}

.target-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bid-input {
    width: 80px;
}

.status-select,
.action-select {
    width: 100px;
}

.back-button {
    margin-top: 20px;
}

.active {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* Red text for pause action */
.action-pause {
    color: #f87171 !important;
}

/* Updated input color for bid changes */
.bid-changed {
    color: #f87171;
}

/* Red text for update action */
.action-update {
    color: #f87171 !important;
}

/* Sortable column headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background-color: #3a3a3c;
}

.sortable::after {
    content: ' ↕';
    opacity: 0.5;
    font-size: 12px;
}

.sortable.sort-asc::after {
    content: ' ↑';
    opacity: 1;
}

.sortable.sort-desc::after {
    content: ' ↓';
    opacity: 1;
}

/* Force JetBrains Mono on buttons and form inputs */
button, 
.export-btn,
input,
select,
.results-table input,
.results-table select {
    font-family: 'JetBrains Mono', monospace !important;
}

/* Table column colorization */
.results-table .target-cell {
    color: #4FC1FF; /* light blue/cyan for Target column */
}

.results-table .status-cell {
    color: #4EC9B0; /* green/yellow-green for Status column */
}

.results-table .spend-cell,
.results-table .sales-cell {
    color: #df8d2d; /* orange for Spend and Sales columns */
}

@media (max-width: 768px) {
    .summary-grid { grid-template-columns: 1fr; }
    .funnel-stats { grid-template-columns: 1fr; }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .table-summary {
        justify-content: space-around;
    }
    
    .table-container {
        overflow-x: auto;
    }
}

.table-controls-distributed {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 20px;
    align-items: center;
}

.table-controls-distributed select:first-child {
    justify-self: center; /* Center above first Spend/Sales pair */
}

.table-controls-distributed select:nth-child(2) {
    justify-self: center; /* Center above second Spend/Sales pair */
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background: #2c2c2e;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    padding: 20px;
}

.selector-layout {
    display: grid;
    grid-template-columns: 200px 120px 180px 120px 120px 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.timeframe-select {
    background: #1d4ed8;
    color: #ffffff;
    border: 1px solid #1d4ed8;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
}

.timeframe-select:hover {
    background: #2563eb;
}

.timeframe-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.3);
}

.selector-layout {
    display: grid;
    grid-template-columns: 200px 120px 60px 120px 1fr;
    gap: 12px;
    align-items: center;
    width: 100%;
}
.export-button {
    border: 1px solid #059669;
    min-width: 220px; /* Force wider button */
    white-space: nowrap; /* Prevent text wrapping */
    text-align: center; /* Center the text */
    
}

/* Table column colorization */
.results-table .target-cell {
    color: #4FC1FF; /* light blue/cyan for Target column */
}

.results-table .status-cell {
    color: #4EC9B0; /* green/yellow-green for Status column */
}

.results-table .spend-cell,
.results-table .sales-cell {
    color: #df8d2d; /* orange for first Spend and Sales columns */
}

/* Purple color for second set of spend/sales columns */
.results-table .spend-cell-long,
.results-table .sales-cell-long {
    color: #ea02f3; /* purple for second Spend and Sales columns */
}