:root {
    /* CKW Brand Colors */
    --c-white: #ffffff;
    --c-black: #111111;
    --c-ckw-green: #c5d600;
    --c-grey-light: #f4f4f4; /* Search bar style */
    --c-grey-border: #e5e5e5;
    --c-grey-text: #666666;
    
    --c-active-bg: #f8faed; /* Very pale green for active items */
    --c-error: #e53e3e;
    
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --border-radius: 24px;
    --transition: all 0.2s ease;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--c-white);
    color: var(--c-black);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* Header */
.app-header {
    background: var(--c-white);
    padding: 20px 24px;
    border-bottom: 1px solid var(--c-grey-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: baseline;
}

.logo-text {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1.5px;
}

.logo-dot {
    font-size: 32px;
    font-weight: 700;
    color: var(--c-ckw-green);
}

.logo-subtext {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-black);
    letter-spacing: 0px;
    margin-top: -4px;
}

/* Layout */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Typography */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--c-black);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Forms & Inputs */
.control-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group.half {
    flex: 1;
}

label {
    font-size: 14px;
    color: var(--c-black);
    font-weight: 600;
    margin-left: 8px;
}

input, select {
    appearance: none;
    background-color: var(--c-grey-light);
    border: none;
    color: var(--c-black);
    font-family: var(--font-main);
    font-size: 16px;
    padding: 14px 20px;
    border-radius: var(--border-radius);
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '↓';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--c-black);
    pointer-events: none;
}

input:focus, select:focus {
    background-color: var(--c-active-bg);
    box-shadow: inset 0 0 0 2px var(--c-ckw-green);
}

/* Specific styling for datetime pickers to look native */
input[type="date"], input[type="time"] {
    position: relative;
}

/* Button */
.primary-btn {
    background-color: var(--c-ckw-green);
    color: var(--c-black);
    border: none;
    border-radius: var(--border-radius);
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.primary-btn:hover {
    filter: brightness(0.95);
}

.primary-btn:active {
    transform: scale(0.98);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--c-black);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* Messages */
.progress-message {
    color: var(--c-black);
    background: var(--c-active-bg);
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}

.error-message {
    background: rgba(229, 62, 62, 0.1);
    color: var(--c-error);
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
}

/* Data Sections */
.section-card {
    background: var(--c-white);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.pub-time {
    font-size: 12px;
    color: var(--c-grey-text);
}

/* Chart */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    background-color: var(--c-grey-light);
    border-radius: 16px;
    padding: 16px;
}

.empty-state {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-grey-text);
    font-size: 14px;
    text-align: center;
    padding: 24px;
    border-radius: 16px;
    z-index: 10;
}

/* Table */
.table-container {
    overflow-x: auto;
    border: 1px solid var(--c-grey-border);
    border-radius: 16px;
    max-height: 400px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 16px;
    border-bottom: 1px solid var(--c-grey-border);
}

.data-table th {
    background: var(--c-white);
    color: var(--c-grey-text);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 5;
    text-align: left;
}

.data-table th.text-right {
    text-align: right;
}

.data-table td.text-right {
    text-align: right;
    font-weight: 600;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.price-value {
    color: var(--c-black);
}

/* Mobile specific fixes */
@media (max-width: 480px) {
    .app-container {
        padding: 16px;
    }
    .chart-wrapper {
        height: 250px;
    }
}
