/* NaszeFinanse - Polish Treasury Bonds Tracker */

:root {
    --primary-color: #1a365d;
    --primary-light: #2c5282;
    --accent-color: #c53030;
    --accent-light: #fc8181;
    --bg-color: #f7fafc;
    --card-bg: #ffffff;
    --text-color: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --hover-bg: #edf2f7;
    --fixed-color: #2b6cb0;
    --variable-color: #2f855a;
    --inflation-color: #c05621;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 2rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-light);
}

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

.update-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Table */
.table-container {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-bottom: 2rem;
}

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

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

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

th.sortable::after {
    content: '↕';
    position: absolute;
    right: 0.5rem;
    opacity: 0.5;
    font-size: 0.75rem;
}

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

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

th.sortable:hover {
    background: var(--primary-light);
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--hover-bg);
}

td {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
}

td.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Category badges */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.category-badge.fixed {
    background: #ebf8ff;
    color: var(--fixed-color);
}

.category-badge.variable {
    background: #f0fff4;
    color: var(--variable-color);
}

.category-badge.inflation {
    background: #fffaf0;
    color: var(--inflation-color);
}

/* Rate styling */
.rate {
    font-weight: 600;
    color: var(--primary-color);
}

.rate-high {
    color: var(--variable-color);
}

/* Symbol */
.symbol {
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 600;
}

/* Legend */
.legend {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.legend h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.legend ul {
    list-style: none;
}

.legend li {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

footer p {
    font-size: 0.875rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--accent-light);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer .disclaimer {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
        text-align: center;
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .category-badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .table-container {
        border-radius: 0;
        margin-left: -1rem;
        margin-right: -1rem;
    }

    th:nth-child(3),
    td:nth-child(3) {
        display: none;
    }
}

/* Print styles */
@media print {
    header, footer, .controls {
        display: none;
    }

    .table-container {
        box-shadow: none;
    }

    tbody tr {
        page-break-inside: avoid;
    }
}
