/* =========================
   KUPGRUZA THEME (chrome + snow)
   ========================= */

:root{
    --kg-ink: #0b0b0f;
    --kg-paper: #f8f9fb;
    --kg-snow: #cfd3d8;
    --kg-panel: #ffffff;

    --kg-cyan: #22d3ff;
    --kg-blue: #1d4ed8;
    --kg-deep: #0b1b5a;
    --kg-violet: #6d5bd0;

    --kg-accent: var(--kg-cyan);
    --kg-border: #000;

    --kg-shadow: 6px 6px 0 #000;
    --kg-shadow-sm: 3px 3px 0 #000;
}

/* GLOBALNE */
body {
    font-family: Verdana, sans-serif;
    color: var(--kg-ink);
    margin: 0;
    padding: 0;
    text-align: center;

    /* “śnieg” + lekka głębia */
    background-color: var(--kg-snow);
    background-image:
            radial-gradient(circle at 20% 30%, rgba(255,255,255,0.55) 0 1px, transparent 2px),
            radial-gradient(circle at 70% 60%, rgba(255,255,255,0.35) 0 1px, transparent 2px),
            radial-gradient(circle at 40% 80%, rgba(255,255,255,0.25) 0 1px, transparent 2px),
            linear-gradient(to bottom, #d6d9de 0%, #bfc5cc 100%);
    background-size: 14px 14px, 18px 18px, 22px 22px, auto;
}

/* a11y helper */
.sr-only{
    position:absolute;
    width:1px;height:1px;
    padding:0;margin:-1px;
    overflow:hidden;clip:rect(0,0,0,0);
    white-space:nowrap;border:0;
}

/* =========================
   HEADER + NAV
   ========================= */
.kg-header{
    border-bottom: 4px solid var(--kg-border);
    background:
            linear-gradient(to bottom, #e8edf3 0%, #cfd7e3 60%, #b9c4d6 100%);
}

.kg-header-inner{
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 14px 16px 14px;

    display: flex;
    flex-direction: column;     /* klucz: logo na górze, nav pod spodem */
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.kg-brand{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;

    /* żeby logo miało “scenę” */
    width: 100%;
}

.kg-logo{
    height: 140px;              /* DUŻE logo */
    width: auto;
    display: block;

    filter: drop-shadow(6px 6px 0 #000);
}

/* NAV pod logo */
.kg-nav{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;    /* wycentrowane pod logo */
    align-items: center;

    width: 100%;
}
.kg-nav-link, .kg-nav-btn{
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    padding: 8px 12px;

    color: #00122b;
    background:
            linear-gradient(to bottom, #ffffff 0%, #e6eefc 45%, #cfe0ff 100%);
    border: 3px solid var(--kg-border);
    box-shadow: var(--kg-shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.kg-nav-link:hover, .kg-nav-btn:hover{
    background:
            linear-gradient(to bottom, #ffffff 0%, #dff6ff 45%, #b8eeff 100%);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #000;
    cursor: pointer;
}

.kg-logout{
    display: inline;
}

/* =========================
   MAIN / HERO
   ========================= */
.kg-main{
    padding: 20px 12px 30px 12px;
}

.kg-hero{
    display: grid;
    place-items: center;
}

.kg-window{
    width: min(920px, 96vw);
    background: var(--kg-panel);
    border: 4px solid var(--kg-border);
    box-shadow: var(--kg-shadow);
    text-align: left;
}

.kg-titlebar{
    display:flex;
    justify-content: space-between;
    align-items:center;
    padding: 10px 12px;
    border-bottom: 3px solid var(--kg-border);
    font-weight: bold;

    color: #fff;
    background: linear-gradient(to bottom, var(--kg-cyan) 0%, var(--kg-blue) 55%, var(--kg-deep) 100%);
    text-shadow: 2px 2px 0 #000;
}

.kg-titlebar-dots{
    font-size: 12px;
    opacity: 0.9;
}

.kg-window-body{
    padding: 18px;
}

.kg-hero-title{
    margin: 0 0 10px 0;
    font-size: 26px;
    letter-spacing: 0.2px;
}

.kg-hero-sub{
    margin: 0 0 16px 0;
    line-height: 1.5;
    color: #101317;
}

.kg-hero-actions{
    display:flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 14px 0;
}

/* Buttons (spójne wszędzie) */
.kg-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap: 8px;

    padding: 10px 14px;
    border: 3px solid var(--kg-border);
    box-shadow: var(--kg-shadow-sm);
    font-weight: bold;
    text-decoration: none;
    color: #00122b;
}

.kg-btn-primary{
    background: linear-gradient(to bottom, #ffffff 0%, #dff6ff 40%, #a8ecff 100%);
}

.kg-btn-ghost{
    background: linear-gradient(to bottom, #ffffff 0%, #f0f3f8 60%, #dde3ee 100%);
}

.kg-btn:hover{
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #000;
}

.kg-badges{
    display:flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.kg-badge{
    font-size: 12px;
    padding: 4px 8px;
    border: 2px solid #000;
    background: #eef2f7;
}

/* =========================
   Twoje istniejące style (zostawione, lekko podkolorowane)
   ========================= */

/* TABELKI */
table {
    width: 90%;
    border: 3px solid black;
    background-color: white;
    margin: auto;
    text-align: left;
}

th {
    background: linear-gradient(to bottom, var(--kg-cyan), var(--kg-blue));
    color: white;
    padding: 10px;
    border: 2px solid black;
    text-shadow: 1px 1px 0 #000;
}

td {
    padding: 10px;
    border: 2px solid black;
}

/* PRZYCISKI globalne (np. formularze) */
button {
    font-size: 15px;
    font-weight: bold;
    padding: 10px 12px;
    border: 3px solid var(--kg-border);
    background: linear-gradient(to bottom, #ffffff 0%, #e6eefc 45%, #cfe0ff 100%);
    color: #00122b;
    cursor: pointer;
    box-shadow: var(--kg-shadow-sm);
}

button:hover {
    background: linear-gradient(to bottom, #ffffff 0%, #dff6ff 45%, #b8eeff 100%);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #000;
}

/* Retro styl galerii */
.carousel {
    position: relative;
    width: 500px;
    height: 350px;
    background-color: white;
    border: 4px solid black;
    box-shadow: 5px 5px black;
    margin: auto;
    padding: 10px;
    overflow: hidden;
}

.carousel-images {
    display: flex;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

.slide.active { display: block; }

.carousel-images:hover .slide.active { transform: scale(2); }
.carousel-images:not(:hover) .slide.active { transform: scale(1); }

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 10;
}

.prev, .next {
    background: linear-gradient(to bottom, #ffffff 0%, #dff6ff 45%, #a8ecff 100%);
    color: #00122b;
    border: 3px solid black;
    padding: 12px 20px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 3px 3px black;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.92;
    transition: opacity 0.2s ease-in-out;
}

.prev { left: 5px; }
.next { right: 5px; }

.prev:hover, .next:hover {
    opacity: 1;
    transform: translateY(-50%) translate(-1px, -1px);
}

/* Auth / okna */
.auth-container {
    display: flex;
    justify-content: center;
    padding: 30px 10px;
}

.window {
    width: min(520px, 95vw);
    background-color: white;
    border: 4px solid black;
    box-shadow: 6px 6px black;
}

.titlebar {
    background: linear-gradient(to bottom, var(--kg-cyan), var(--kg-blue), var(--kg-deep));
    color: white;
    padding: 10px 12px;
    font-weight: bold;
    border-bottom: 3px solid black;
    text-shadow: 2px 2px 0 #000;
}

.window-body {
    padding: 18px;
    text-align: left;
}

.auth-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.auth-form label { font-weight: bold; }

.auth-form input {
    padding: 10px;
    font-size: 14px;
    border: 3px inset gray;
    background-color: #f8f8f8;
}

.auth-form input:focus { outline: 2px solid var(--kg-blue); }

.alert {
    padding: 10px 12px;
    border: 3px solid black;
    margin-bottom: 10px;
    font-weight: bold;
}

.alert.success { background-color: #ccffcc; }
.alert.info { background-color: #dfe7ff; }
.alert.error { background-color: #ffcccc; }

/* ADD AD FORM */
main { text-align: center; }

.form-window {
    width: min(920px, 96vw);
    margin: 16px auto 30px auto;
    background: white;
    border: 4px solid black;
    box-shadow: 6px 6px black;
    text-align: left;
}

.form-titlebar {
    background: linear-gradient(to bottom, var(--kg-cyan), var(--kg-blue), var(--kg-deep));
    color: white;
    padding: 10px 12px;
    font-weight: bold;
    border-bottom: 3px solid black;
    text-shadow: 2px 2px 0 #000;
}

.form-body { padding: 16px; }

.section {
    background: #ffffff;
    border: 2px solid #000;
    padding: 14px;
}

.section h3 {
    background: #e7ecf5;
    border: 1px solid #000;
    padding: 8px 10px;
    margin: 0 0 12px 0;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.field { display: grid; gap: 8px; }
.field label { font-weight: bold; }

.field:focus-within {
    outline: 2px solid var(--kg-blue);
    outline-offset: 2px;
    background: #f3f6ff;
}
.listing-form { display: grid; gap: 16px; }

.listing-form input[type="text"],
.listing-form input[type="number"],
.listing-form input[type="date"],
.listing-form textarea,
.listing-form select {
    padding: 12px;
    font-size: 15px;
    border: 2px inset #7a7a7a;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
    color: #000;
}

.listing-form textarea { min-height: 140px; resize: vertical; }

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 980px) {
    .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .kg-brand{ height: 72px; }
    .kg-logo{ height: 100%; }
}

/* =========================
   FOOTER
   ========================= */
.kg-footer{
    margin-top: 20px;
    border-top: 4px solid #000;
    background: linear-gradient(to bottom, #10131a 0%, #05060a 100%);
    color: #fff;
    text-align: center;
}

.kg-footer-inner{
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 14px;
}

.kg-footer-links{
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.kg-footer-link{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 2px solid #000;
    background: linear-gradient(to bottom, #ffffff 0%, #dff6ff 45%, #a8ecff 100%);
    color: #00122b;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 2px 2px 0 #000;
}

.kg-footer-button{
    cursor: pointer;
    font-family: inherit;
}

.kg-footer-copy{
    margin: 0 0 8px 0;
    font-size: 12px;
    opacity: 0.9;
}

.kg-footer-company{
    border: 2px solid #000;
    background: linear-gradient(to bottom, #1b2a6b 0%, #0b1b5a 100%);
    box-shadow: 3px 3px 0 #000;
    padding: 8px 10px;
    font-size: 12px;
}

.kg-footer-company p{
    margin: 4px 0;
}

.kg-footer-company a{
    color: #a8ecff;
}
/* =========================
   SUGGESTIONS DROPDOWN (nie rozwala layoutu)
   ========================= */

.suggest-wrap{
    position: relative; /* ważne: kotwica dla dropdownu */
}

/* dropdown jako overlay, nie element w flow */
.suggest-box{
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);

    max-height: 240px;        /* przewijanie zamiast rozjeżdżania strony */
    overflow-y: auto;

    background: #ffffff;
    border: 3px solid #000;
    box-shadow: var(--kg-shadow-sm);

    z-index: 9999;            /* nad resztą UI */
}

/* jeśli Twoje JS wrzuca elementy jako <div> lub <button> */
.suggest-box > *{
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-bottom: 1px solid #000;
    background: #fff;
    cursor: pointer;
    text-align: left;
    box-sizing: border-box;
}

/* hover */
.suggest-box > *:hover{
    background: #e7ecf5;
}

/* opcjonalnie: ostatni bez kreski */
.suggest-box > *:last-child{
    border-bottom: 0;
}

/* LEGAL PAGES */
.legal-page{
    display: grid;
    place-items: center;
}

.legal-doc{
    width: min(980px, 96vw);
    background: #fff;
    border: 4px solid #000;
    box-shadow: var(--kg-shadow);
    text-align: left;
    padding: 20px;
}

.legal-doc h1{
    margin: 0 0 8px 0;
}

.legal-doc h2{
    margin-top: 20px;
    margin-bottom: 8px;
}

.legal-doc p,
.legal-doc li{
    line-height: 1.5;
}

.legal-version{
    display: inline-block;
    padding: 6px 10px;
    border: 2px solid #000;
    background: #eef2f7;
    margin-bottom: 12px;
}

.legal-doc ul,
.legal-doc ol{
    padding-left: 20px;
}

/* COOKIE CONSENT */
.kg-cookie-banner{
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 10000;
}

.kg-cookie-content{
    max-width: 980px;
    margin: 0 auto;
    background: #fff;
    border: 4px solid #000;
    box-shadow: var(--kg-shadow);
    padding: 14px;
    text-align: left;
}

.kg-cookie-title{
    margin: 0 0 6px 0;
    font-weight: bold;
}

.kg-cookie-text{
    margin: 0 0 12px 0;
}

.kg-cookie-actions{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kg-cookie-modal{
    position: fixed;
    inset: 0;
    z-index: 20000;
}

.kg-cookie-backdrop{
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
}

.kg-cookie-modal-content{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20001;
    width: min(560px, 96vw);
    background: #fff;
    border: 4px solid #000;
    box-shadow: var(--kg-shadow);
    text-align: left;
    padding: 16px;
}

.kg-cookie-option{
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.consent-row{
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 0;
}

.field-help{
    margin-top: 6px;
    font-size: 12px;
    opacity: 0.9;
}
