/* 1. Globalne wymuszenie czcionki Inter i optymalizacja renderingu na Windowsie */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 2. Zapobieganie rozmyciom warstw GPU (kompozytor Blink na Windowsie) */
.glass, .station-card, .solari-tile, .solari-board, .solari-board-list {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* CSS Variables - Motywy kolorystyczne */
:root[data-theme="black"] {
    --bg-main: #050508;
    --text-main: #e5e7eb;
    --glass-bg: rgba(13, 17, 23, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --header-bg: rgba(13, 17, 23, 0.85);
    --card-hover-border: rgba(255, 255, 255, 0.3);
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --accent-color: #38bdf8;
}

:root[data-theme="white"] {
    --bg-main: #f1f5f9;
    --text-main: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    --header-bg: rgba(255, 255, 255, 0.9);
    --card-hover-border: rgba(0, 0, 0, 0.3);
    --modal-overlay: rgba(15, 23, 42, 0.6);
    --accent-color: #0284c7;
}

:root[data-theme="hud"] {
    --bg-main: #020d08;
    --text-main: #22c55e;
    --glass-bg: rgba(4, 20, 12, 0.9);
    --glass-border: rgba(34, 197, 94, 0.3);
    --header-bg: rgba(4, 20, 12, 0.95);
    --card-hover-border: rgba(34, 197, 94, 0.7);
    --modal-overlay: rgba(2, 13, 8, 0.85);
    --accent-color: #4ade80;
}

:root[data-theme="bluenavi"] {
    --bg-main: #0b132b;
    --text-main: #e0e1dd;
    --glass-bg: rgba(28, 37, 65, 0.85);
    --glass-border: rgba(72, 149, 239, 0.2);
    --header-bg: rgba(28, 37, 65, 0.9);
    --card-hover-border: rgba(72, 149, 239, 0.5);
    --modal-overlay: rgba(11, 19, 43, 0.85);
    --accent-color: #64dfdf;
}

:root[data-theme="splitflap"] {
    --bg-main: #0a0a0a;
    --text-main: #fef1cd;
    --glass-bg: rgba(18, 18, 18, 0.95);
    --glass-border: rgba(255, 204, 0, 0.3);
    --header-bg: rgba(15, 15, 15, 0.98);
    --card-hover-border: #ffcc00;
    --modal-overlay: rgba(0, 0, 0, 0.9);
    --accent-color: #ffcc00;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.glass { 
    background: var(--glass-bg); 
    backdrop-filter: blur(12px); 
    border-color: var(--glass-border);
    transition: all 0.3s ease;
}

.station-card { 
    transition: all 0.2s ease; 
    border: 1px solid var(--glass-border); 
}

.station-card:hover { 
    transform: translateY(-2px); 
    border-color: var(--card-hover-border); 
}

summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }

/* Dostosowanie tekstów interfejsu dla motywu White */
[data-theme="white"] .text-gray-500 { color: #64748b; }
[data-theme="white"] .text-gray-400 { color: #475569; }
[data-theme="white"] .text-gray-300 { color: #334155; }
[data-theme="white"] .text-white { color: #0f172a; }
[data-theme="white"] .bg-white\/5 { background-color: rgba(0, 0, 0, 0.05); }
[data-theme="white"] .bg-white\/10 { background-color: rgba(0, 0, 0, 0.08); }
[data-theme="white"] .border-white\/10 { border-color: rgba(0, 0, 0, 0.1); }
[data-theme="white"] .border-white\/20 { border-color: rgba(0, 0, 0, 0.2); }
[data-theme="white"] .text-sky-400 { color: #0284c7; }

/* Motyw HUD Font & Glow */
[data-theme="hud"] {
    font-family: 'Courier New', Courier, monospace !important;
}

[data-theme="hud"] h1, [data-theme="hud"] h2, [data-theme="hud"] summary {
    text-shadow: 0 0 5px rgba(34, 197, 94, 0.6);
}

/* Stylizacja dla motywu Tablicy Dworcowej */
[data-theme="splitflap"] {
    font-family: 'Consolas', 'Courier New', monospace !important;
    text-transform: uppercase;
}

[data-theme="splitflap"] h1, [data-theme="splitflap"] h2, [data-theme="splitflap"] summary {
    color: #ffcc00 !important;
    letter-spacing: 0.15em;
    text-shadow: 0 0 4px rgba(255, 204, 0, 0.4);
}

[data-theme="splitflap"] .station-card, 
[data-theme="splitflap"] .glass {
    border: 1px solid #333333;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

/* KAFELEK SPLIT-FLAP (SOLARI) W SEKCJI NADAJE - WIDOK GRID */
.solari-board {
    background-color: #1a1a1a;
    border: 3px solid #2d2d2d;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.9), inset 0 0 15px rgba(0,0,0,0.8);
    display: inline-flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.solari-board:hover {
    transform: scale(1.02);
}

.solari-board.trunk-solari {
    border: 3px solid #ffffff !important;
}

/* PASEK SPLIT-FLAP (SOLARI) W SEKCJI NADAJE */
.solari-board-list {
    background-color: #1a1a1a;
    border: 3px solid #2d2d2d;
    border-radius: 10px;
    padding: 8px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.9), inset 0 0 10px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s;
}

.solari-board-list:hover {
    transform: scale(1.01);
}

.solari-board-list.trunk-solari {
    border: 3px solid #ffffff !important;
}

.solari-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.solari-tile {
    position: relative;
    background: linear-gradient(180deg, #282828 0%, #1e1e1e 50%, #181818 51%, #111111 100%);
    color: #fef1cd;
    border: 1px solid #000;
    border-radius: 4px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.15), 0 2px 4px rgba(0,0,0,0.8);
    text-shadow: 0 -1px 0 rgba(0,0,0,0.8);
}

.solari-tile::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.9);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.solari-tile-lg {
    width: 28px;
    height: 42px;
    font-size: 24px;
}

.solari-tile-sm {
    width: 18px;
    height: 28px;
    font-size: 15px;
}

.solari-tile-clock {
    width: 22px;
    height: 32px;
    font-size: 18px;
    color: #fef1cd;
}

.solari-label {
    color: #fef1cd;
    font-size: 12px;
    font-weight: bold;
    margin-left: 6px;
    margin-right: 6px;
    letter-spacing: 1px;
}

[data-theme="splitflap"] .splitflap-table {
    font-family: 'Consolas', 'Courier New', monospace;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

[data-theme="splitflap"] .splitflap-table th {
    color: #ffcc00;
    border-bottom: 1px solid #333;
    letter-spacing: 0.05em;
    padding: 4px 4px;
}

[data-theme="splitflap"] .splitflap-table td {
    color: #fef1cd;
    border-bottom: 1px solid #1a1a1a;
    padding: 4px 4px;
}

[data-theme="splitflap"] .splitflap-table tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.layout-split-active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .layout-split-active {
	flex-direction: row;
	align-items: flex-start;
    }
}