@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --card-bg: #151c2c;
    --border-color: #242f47;
    --text-main: #f8fafc;
    --text-muted: #64748b;

    --color-diesel: #f59e0b;
    --color-pb95: #10b981;
    --color-pb98: #06b6d4;
    --color-lpg: #b1cc16;
}

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

body {
    font-family: 'Plus Jakarta Sans';
    background:
        radial-gradient(ellipse at 0% 0%, rgba(36, 74, 241, 0.18) 0px, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(60, 27, 139, 0.22) 0px, transparent 50%),
        linear-gradient(175deg, #0a0e1c 0%, #070a16 40%, #04060f 100%);
    color: var(--text-main);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    font-size: 35px;
    font-weight: 700;
    color: #4f46e5;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 2px;
}

header p {
    color: #475569;
    font-size: 15px;
}

main {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
}


/* DYSTRYBUTOR / PANELS */
.panel,
.history-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

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

.panel-title h2 {
    font-size: 20px;
    font-weight: 600;
    color: #f1f5f9;
}

.panel-title span {
    font-size: 13px;
    color: #475569;
    font-weight: 500;
}

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

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

input,
select {
    background: #0d121f;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: 0.2s;
}

input:hover,
select:hover {
    border-color: #334155;
}

input:focus,
select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

input::placeholder {
    color: rgba(255, 255, 255, 0.5)
}

select:invalid {
    color: rgba(255, 255, 255, 0.5);
}

select option {
    color: var(--text-main);
}

button {
    font-weight: 600;
    font-size: 14px;
    padding: 14px 22px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confirm-btn {
    background: linear-gradient(to right, #4f46e5, #3b82f6, #4338ca, #2563eb);
    background-size: 200% auto;
    color: white;
    width: 100%;
    transition: 0.5s;
}

.confirm-btn:hover {
    background-position: right center;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

button:active {
    transform: scale(0.98);
}

/* LICZNIK TANKOWANIA */
.dispenser-display {
    background: #090d16;
    border: 1px dashed #2e3f62;
    border-radius: 12px;
    padding: 25px;
    height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: relative;
    box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.55), inset 0 0 40px rgba(5, 10, 25, 0.4);
}

.screen-active {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.digits-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 8px 0;
    gap: 12px;
}

.digit-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #060910;
    border: 1px solid #1a2540;
    border-radius: 8px;
    padding: 8px 12px;
}

.digit-label {
    font-size: 11px;
    color: #475569;
    text-transform: uppercase;
    font-weight: 600;
}

.digit-value {
    font-size: 32px;
    font-weight: 700;
    color: #10b981;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.refueling-progress {
    width: 100%;
    height: 8px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #10b981, #3b82f6);
    transition: 0.1s linear;
}

/* CENY PALIWA */
.prices-dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.price-card-diesel,
.price-card-pb95,
.price-card-pb98,
.price-card-lpg {
    background: #0d121f;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
}

.price-card-diesel:hover,
.price-card-pb95:hover,
.price-card-pb98:hover,
.price-card-lpg:hover {
    border-color: #334155;
}

.price-card-diesel {
    border-top: 3px solid var(--color-diesel);
}

.price-card-pb95 {
    border-top: 3px solid var(--color-pb95);
}

.price-card-pb98 {
    border-top: 3px solid var(--color-pb98);
}

.price-card-lpg {
    border-top: 3px solid var(--color-lpg);
}

.price-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.price-currency {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.price-value-input {
    width: 75px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-main);
    background: transparent;
    border: none;
    border-bottom: 1px dashed #334155;
    padding: 2px 0;
    text-align: center;
    border-radius: 0;
}

.price-value-input:focus {
    border-bottom: 1px solid #4f46e5;
    box-shadow: none;
}

/* ZBIORNIKI */
.fuel-tanks-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.tank-diesel,
.tank-pb95,
.tank-pb98,
.tank-lpg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.tank-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.tank-visual {
    width: 100%;
    height: 185px;
    background: #090d16;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: 0.3s;
}

.tank-visual:hover {
    border-color: #334155;
}

.tank-liquid {
    width: 100%;
    height: 0%;
    position: relative;
    transition: height 0.1s linear;
    opacity: 0.85;
}

/* Animacja płynu w zbiorniku (duże wsparcie internetem)*/
.tank-liquid::before {
    content: "";
    position: absolute;
    width: 330px;
    height: 330px;
    top: -314px;
    left: calc(50% - 165px);
    border-radius: 43%;
    background: #090d16;
    opacity: 1;
    animation: rotate-wave-back 16s linear infinite;
    z-index: 1;
}

.tank-liquid::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    top: -302px;
    left: calc(50% - 160px);
    border-radius: 40%;
    background: #090d16;
    opacity: 0.5;
    animation: rotate-wave-front 10s linear infinite;
    z-index: 2;
}

@keyframes rotate-wave-back {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes rotate-wave-front {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ----------------------------------------- */

.tank-info {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.tank-percent {
    font-size: 18px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.tank-liters {
    font-size: 10px;
    color: #f1f5f9;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    font-weight: 500;
    margin-top: 2px;
}

.refill-controls {
    background: #0d121f;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.refill-inputs {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
}

.refill-btn {
    background: linear-gradient(to right, #0ca85a, #0baa9d, #019149, #03998c);
    background-size: 200%;
    color: white;
    width: 100%;
    transition: 0.4s;
}

.refill-btn:hover {
    background-position: right center;
    box-shadow: 0 4px 12px rgba(10, 136, 90, 0.2);
}


/* HISTORIA */
.history-panel {
    grid-column: span 2;
}

.history-container {
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #090d16;
    scrollbar-width: thin;
    scrollbar-color: #1e293b #090d16;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

.history-table th,
.history-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.history-table th {
    background: #0c111c;
    color: var(--text-muted);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

.history-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.no-history {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
}

/* STOPKA */
footer {
    width: 100%;
    max-width: 1200px;
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #475569;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

/* PARAGON */
.receipt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
    opacity: 0;
    visibility: hidden;
}

.receipt-content {
    background: white;
    color: #1f2937;
    width: 320px;
    border-radius: 12px;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.receipt-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    color: #1f2937;
    font-size: 22px;
    padding: 0;
    cursor: pointer;
}

.receipt-header {
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.4;
}

.receipt-divider {
    border-top: 1px dashed #9ca3af;
    margin: 8px 0;
}

.receipt-row,
.receipt-total-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

.receipt-total-row {
    font-weight: bold;
    font-size: 15px;
    margin-top: 8px;
}

/* KOMUNIKATY */

#output-data {
    opacity: 0;
    margin-top: 15px;
    padding: 0 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid transparent;
    max-height: 0;
    transition: all 0.5s ease;
}

#output-data.error {
    opacity: 1;
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 12px;
    max-height: 80px;
}

#output-data.success {
    opacity: 1;
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
    padding: 12px;
    max-height: 80px;
}

/* RESPONSYWNOŚĆ */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    .history-panel {
        grid-column: 1;
    }

    .input-row,
    .refill-inputs {
        grid-template-columns: 1fr;
    }
}