/* =========================================================
   panel-styles.css  –  Wspólny layout panelu użytkownika moje-*
   ========================================================= */

/* ---------- Zmienne ---------- */
:root {
    --sidebar-w: 270px;
    --topbar-h: 110px;
    --color-gold: #e0c472;
    --color-gold-dark: #c4a952;
    --sidebar-dark: #000;
    --sidebar-light: #807e7e;
    --green-dark: rgb(8, 61, 34);
    --bg-light: #e0e0e0;
}

/* ---------- Wrapper całej strony ---------- */
.panel-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    padding-bottom: 70px;
}

/* ---------- Górny pasek (topbar + logo) ---------- */
.panel-top-row {
    display: flex;
    flex-shrink: 0;
    height: var(--topbar-h);
    background: var(--sidebar-dark);
    border-bottom: 1px solid rgba(224, 196, 114, .4);
    position: relative;
    z-index: 10;
}

body.light-theme .panel-top-row {
    background: var(--sidebar-light);
}

/* Logo D w lewym górnym rogu */
.panel-logo-area {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: none;
    margin-left: -40px;
}

.panel-logo-area a {
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-logo-area img {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

/* Napis DOMENTI między logo D a kółkami */
.panel-logo-text {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    flex-shrink: 0;
    margin-left: -80px;
    margin-top: 20px;
}

.panel-logo-text a {
    display: flex;
    align-items: center;
}

.panel-logo-text img {
    height: 100px;
    width: 240px;
    object-fit: contain;
}

/* Topbar z kółkami */
.panel-topbar {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    overflow: hidden;
}

/* ---------- Kółka nawigacji ---------- */
.nav-circles {
    display: flex;
    gap: 28px;
    justify-content: auto;
    align-items: center;
    flex-wrap: nowrap;
    margin-left: 15px;
    margin-top: 2px;
}

.nav-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--color-gold);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    font-size: 12px;
    border: 2px solid var(--color-gold-dark);
    box-shadow: 0 2px 5px rgba(0, 0, 0, .3);
    transition: all .2s ease-in-out;
    text-align: center;
    flex-shrink: 0;
}

body.light-theme .nav-circle {
    background-color: #e0e0e0;
    border-color: #ccc;
    color: #333;
}

.nav-circle i {
    font-size: 22px;
    margin-bottom: 3px;
}

.nav-circle:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, .4);
}

.nav-circle.active {
    border-color: #fff;
    transform: scale(1.05);
}

body.light-theme .nav-circle.active {
    border-color: #0c5730;
}

.nav-circle.logout {
    background-color: #e74c3c !important;
    border-color: #c0392b !important;
    color: white !important;
}


/* ---------- Dolny rząd (sidebar + treść) ---------- */
.panel-bottom-row {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ---------- Sidebar ---------- */
.panel-sidebar {
    width: var(--sidebar-w);
    min-width: var(--sidebar-w);
    background: var(--sidebar-dark);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 12px rgba(0, 0, 0, .15);
}

body.light-theme .panel-sidebar {
    background: var(--sidebar-light);
}

/* Box użytkownika w sidebarze */
.sidebar-user-box {
    padding: 10px 14px 10px;
    display: flex;
    align-items: center;
    gap: 25px;
    border-bottom: 1px solid rgba(224, 196, 114, .25);
    margin: 0 10px 4px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .05);
}

body.light-theme .sidebar-user-box {
    border-color: rgba(0, 0, 0, .15);
    background: rgba(0, 0, 0, .05);
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    background: var(--color-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #333;
    flex-shrink: 0;
}

body.light-theme .sidebar-user-avatar {
    background: #555;
    color: #fff;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-user-name {
    font-weight: bold;
    font-size: 12px;
    color: var(--color-gold);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.light-theme .sidebar-user-name {
    color: #000;
}

.sidebar-user-diamonds {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #ccc;
}

body.light-theme .sidebar-user-diamonds {
    color: #333;
}

.sidebar-user-diamonds i {
    color: #00bfff;
    font-size: 12px;
}

/* Menu boczne */
.panel-sidebar .sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 40px 0 0;
    flex: 1;
}

.panel-sidebar .sidebar-menu li {
    padding: 20px 26px;
    font-size: 1em;
    cursor: pointer;
    border-left: 4px solid transparent;
    transition: background .18s;
    color: #d1b666;
}

body.light-theme .panel-sidebar .sidebar-menu li {
    color: #000;
}

.panel-sidebar .sidebar-menu li.active,
.panel-sidebar .sidebar-menu li:hover {
    background: #242e42;
    border-left-color: #33aaff;
    color: #f1e0ab;
}

body.light-theme .panel-sidebar .sidebar-menu li.active,
body.light-theme .panel-sidebar .sidebar-menu li:hover {
    background: #666;
}

.panel-sidebar .sidebar-menu li.logout {
    color: #ff7276;
    font-weight: bold;
    margin-top: 20px;
}

.panel-sidebar .sidebar-menu li.logout:hover {
    background: none;
    color: #e11;
    border-left-color: transparent;
}

/* ---------- Obszar treści ---------- */
.panel-content-area {
    flex: 1;
    display: flex;
    padding: 20px 16px 0 16px;
    gap: 16px;
    min-width: 0;
    align-items: flex-start;
    margin-right: 10px;
}

.panel-main-content {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* Naprawia zbyt mocno zwężone boxy */
.panel-main-content .add-ad-section,
.panel-main-content .add-paid-ad-section,
.panel-main-content .ad-item,
.panel-main-content .job-item,
.panel-main-content .property-item {
    margin-left: 0;
}

/* Box reklamowy po prawej */
.panel-ad-box {
    width: 320px;
    min-width: 320px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px dashed rgba(224, 196, 114, .5);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    color: var(--color-gold);
    text-align: center;
    font-size: 15px;
    min-height: 1200px;
    align-self: flex-start;
    margin-right: 10px;
    margin-top: 40px;
}

body.light-theme .panel-ad-box {
    border-color: rgba(12, 87, 48, .5);
    color: #0c5730;
    background-color: rgba(12, 87, 48, .05);
}

/* ── Formularz z reklamami po bokach ── */
.ogloszenie-page-wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 40px 20px 100px 20px;
    align-items: flex-start;
    min-height: calc(100vh - 70px);
    position: relative;
    z-index: 1;
}
.ogloszenie-form-wrapper {
    flex: 0 1 975px;
    max-width: 975px;
    width: 100%;
}
.ogloszenie-ad-left,
.ogloszenie-ad-right {
    width: 320px;
    min-width: 320px;
    min-height: 600px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(224,196,114,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(224,196,114,0.5);
    font-size: 14px;
    align-self: flex-start;
    text-align: center;
}
body.light-theme .ogloszenie-ad-left,
body.light-theme .ogloszenie-ad-right {
    background: rgba(12,87,48,0.05);
    border-color: rgba(12,87,48,0.3);
    color: rgba(12,87,48,0.5);
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
    .panel-ad-box { display: none; }
    .ogloszenie-ad-left,
    .ogloszenie-ad-right { display: none; }
}
@media (max-width: 700px) {
    .ogloszenie-page-wrapper { padding: 10px 10px 100px 10px; gap: 0; }
}

@media (max-width: 900px) {
    .panel-sidebar { display: none; }
    .panel-logo-area { display: none; }
    .panel-logo-text { display: none; }
    .panel-topbar { justify-content: center; }
    .nav-circles { gap: 8px; flex-wrap: wrap; margin-left: 0; }
    .nav-circle { width: 60px; height: 60px; font-size: 10px; }
    .nav-circle i { font-size: 18px; }
    .panel-top-row { height: auto; padding: 8px 10px; }
    .panel-content-area { padding: 10px 8px 0; gap: 8px; }
}

/* ---------- Add buttons row ---------- */
.add-buttons-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}
.add-buttons-row .add-ad-section,
.add-buttons-row .add-paid-ad-section {
    flex: 1;
    width: auto;
    margin-left: 0;
    margin-bottom: 0;
}

/* ---------- Topbar user box ---------- */
.topbar-user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    margin-left: 20px;
    margin-right: auto;
    background: rgba(255, 255, 255, .05);
    border-radius: 7px;
    flex-shrink: 0;
}
.topbar-user-box .user-avatar {
    width: 30px;
    height: 30px;
    font-size: 25px;
    flex-shrink: 0;
}
.topbar-user-box .sidebar-user-name {
    font-weight: bold;
    font-size: 18px;
    color: #e0c472;
}
.topbar-user-box .sidebar-user-diamonds {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    color: #ccc;
}
.sidebar-user-diamonds .diamond-icon {
    font-size: 16px;
}

/* =========================================================
   Wspólne style panelu użytkownika — dodane w refaktorze
   ========================================================= */

/* ── Przycisk logowania w topbarze (gość) ── */
.topbar-login-btn {
    display: inline-block;
    padding: 10px 24px;
    border: 2px solid var(--color-gold);
    border-radius: 5px;
    color: var(--color-gold);
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    background: transparent;
    transition: all .2s ease;
    white-space: nowrap;
}
.topbar-login-btn:hover {
    background-color: var(--color-gold);
    color: #333;
}
body.light-theme .topbar-login-btn {
    color: #fff;
    border-color: #fff;
}
body.light-theme .topbar-login-btn:hover {
    background-color: #fff;
    color: #333;
}

/* ── Body / HTML base ── */
body, html {
    margin: 0; padding: 0;
    background-color: rgb(8, 61, 34);
    color: #fff;
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    transition: background-color .3s ease;
    overflow-x: hidden;
}
body.light-theme { background-color: #e0e0e0; color: #333; }

/* ── Tło z kółkami ── */
.background-circles { position: fixed; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; z-index: 0; pointer-events: none; }
.circle { position: absolute; border-radius: 50%; border: 1px solid #d1be7e; opacity: .15; }
body.light-theme .background-circles { opacity: 0; }

/* ── Panel content offset ── */
.panel-main-content { padding-left: 60px; margin-top: 40px; }

/* ── Modal płatności ── */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 1000; }
.modal-box { background: #fff; color: #333; padding: 30px; border-radius: 12px; width: 90%; max-width: 450px; text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.2); position: relative; }
.modal-box h3 { margin-top: 0; font-size: 1.5em; color: #0c5730; }
.modal-box p { font-size: 1.1em; margin: 15px 0; }
.modal-cost { font-size: 1.8em; font-weight: bold; color: #000; margin: 20px 0; display: flex; justify-content: center; align-items: center; gap: 10px; }
.modal-buttons { display: flex; justify-content: center; gap: 15px; margin-top: 25px; }
.modal-btn { padding: 12px 25px; border: none; border-radius: 8px; font-size: 1em; font-weight: bold; cursor: pointer; transition: background .2s; }
.modal-btn-confirm { background: #4CAF50; color: white; } .modal-btn-confirm:hover { background: #45a049; }
.modal-btn-cancel { background: #f1f1f1; color: #333; border: 1px solid #ccc; } .modal-btn-cancel:hover { background: #e1e1e1; }
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 24px; color: #888; cursor: pointer; }
.diamond-icon { color: #00bfff; font-size: 16px; }

/* ── Wiadomości ── */
.message { padding: 15px; margin-bottom: 20px; border-radius: 5px; font-weight: bold; }
.message.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.message.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.message.info    { background: #e3f2fd; color: #1976d2; border: 1px solid #bbdefb; }
.error-message, .success-message { padding: 12px 20px; border-radius: 8px; margin-bottom: 20px; border-left: 4px solid; font-weight: 500; }
.error-message   { background: #ffebee; color: #c62828; border-left-color: #f44336; }
.success-message { background: #e8f5e8; color: #2e7d32; border-left-color: #4caf50; }

/* ── Przyciski Dodaj ── */
.add-buttons-row { display: flex; gap: 16px; width: 95.7%; margin-bottom: 24px; }
.add-buttons-row .add-ad-section,
.add-buttons-row .add-paid-ad-section { flex: 1; margin-bottom: 0; width: auto; }
.add-ad-section { background: white; border: 1px solid #ddd; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.08); padding: 20px; display: flex; align-items: center; gap: 14px; margin-bottom: 24px; cursor: pointer; transition: box-shadow .1s, background .13s; }
.add-ad-section:hover { background-color: #fafafa; box-shadow: 0 6px 12px rgba(204,204,204,0.3); }
.custom-image-green { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: white; font-weight: bold; background-color: #4CAF50; flex-shrink: 0; }
.add-ad-label { font-weight: bold; font-size: 1.22em; color: #222; margin-left: 4px; }
.add-paid-ad-section { background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); border: 2px solid #ff9800; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.08); padding: 20px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: background .13s; }
.add-paid-ad-section:hover { background: #ffe0b2; }
.custom-image-blue { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; color: white; font-weight: bold; background-color: #ff9800; flex-shrink: 0; }
.add-paid-label { font-weight: bold; font-size: 1.35em; color: #000; margin-left: 4px; }

/* ── Statusy ── */
.status-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.status-badge { font-size: .85em; padding: 4px 12px; border-radius: 12px; font-weight: bold; color: #fff; background: #bbb; display: inline-block; }
.status-badge.published   { background: #4caf50; }
.status-badge.unpublished { background: #f44336; }
.status-badge.paid        { background: #ff8c00; }
.status-badge.expired     { background: #6c757d; }

/* ── Przyciski dni/odśwież ── */
.days-refresh-row { display: flex; gap: 12px; width: auto; margin-top: 15px; }
.days-btn, .refresh-btn { border: 1px solid; padding: 0; border-radius: 4px; font-size: 1.05em; width: 170px; height: 40px; font-weight: 500; text-align: center; text-decoration: none; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s, color .2s; }
.days-btn { background: #fff3e0; color: #ef6c00; border-color: #ff9800; } .days-btn:hover { background: #ff9800; color: #fff; }
.days-btn.warning { background: #d32f2f; color: white; border-color: #b71c1c; }
.refresh-btn { background: #e8f5e8; color: #2e7d32; border-color: #4caf50; } .refresh-btn:hover { background: #4caf50; color: #fff; }
.under-image-section { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 8px; }

/* ── Przyciski akcji ── */
.action-btn { display: block; box-sizing: border-box; width: 105%; padding: 8px 12px; text-align: center; border-radius: 6px; font-weight: 500; border: none; background: #d1b666; color: #020101; box-shadow: 0 2px 4px rgba(0,0,0,0.1); font-size: .9em; transition: all .2s; text-decoration: none; cursor: pointer; line-height: 1.5; font-family: 'Roboto', sans-serif; }
.action-btn:hover { transform: translateY(-1px); }
body.light-theme .action-btn { background: #d6d0d0; color: #020101; }
body.light-theme .action-btn:hover { background: #fff; color: #000; }
.publikuj-btn:hover { background: #095e32; color: #fff; }
body.light-theme .publikuj-btn:hover { background: #22c972; color: #fff; }
.cofnij-btn:hover, .usun-btn:hover { background: #f44336; color: #fff; }
.oplac-btn { background: #ff8c00; color: white; } .oplac-btn:hover { background: #f57c00; color: #fff; }
.action-btn.disabled { background-color: #aaa; color: #555; cursor: not-allowed; }
.action-btn.disabled:hover { transform: none; background-color: #aaa; }

/* ── Elementy listingu (ujednolicone) ── */
.listing-item { background: white; border: 1px solid #ddd; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.08); padding: 20px; display: flex; align-items: flex-start; margin-bottom: 24px; min-height: 145px; position: relative; width: 92%; }
.listing-item.paid { background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%); border: 2px solid #ff9800; box-shadow: 0 6px 15px rgba(255,152,0,0.2); }
.listing-item.unpublished { background: #f5f5f5; border-color: #bbb; }
.listing-item.published   { background: #f5f5f5; border-color: #4caf50; }
.listing-content { display: flex; align-items: flex-start; flex: 1; gap: 20px; }
.listing-image-thumb { width: 150px; height: 150px; border-radius: 8px; object-fit: cover; border: 1px solid #ddd; flex-shrink: 0; }
.listing-info { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.listing-title-link { color: #222; text-decoration: none; font-size: 1.4em; font-weight: bold; line-height: 1.3; margin-bottom: 8px; }
body.light-theme .listing-title-link { color: #000; }
.listing-title-link:hover { text-decoration: underline; }
.listing-actions { position: absolute; top: 9px; right: 20px; width: 160px; display: flex; flex-direction: column; gap: 8px; }

/* ── Brak elementów ── */
.no-items { text-align: center; color: #888; margin-top: 60px; font-size: 1.2em; background: white; padding: 40px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); width: 600px; margin-left: auto; margin-right: auto; }

/* ── Footer ── */
.footer { background-color: #000; padding: 20px 0; display: flex; justify-content: space-around; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 10; }
body.light-theme .footer { background-color: #000; }
.footer-section { display: flex; gap: 30px; }
.footer-link { color: #fff; text-decoration: none; font-size: 14px; }
body.light-theme .footer-link { color: #fff; }
.footer-link:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .panel-main-content { padding-left: 0; }
    .listing-item { flex-direction: column; height: auto; }
    .listing-actions { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
    .action-btn { min-width: 120px; flex: 1; margin: 2px; width: auto; }
    .add-buttons-row { flex-direction: column; width: 100%; }
    .add-buttons-row .add-ad-section,
    .add-buttons-row .add-paid-ad-section { width: 100%; max-width: 100vw; }
    .days-refresh-row { justify-content: flex-start; width: 100%; }
    .footer { flex-direction: column; align-items: center; gap: 15px; padding: 15px 0; }
    .no-items { width: auto; }
}

