
/* ============ RESET & BASE ============ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

img {
    max-width: 100%;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============ ADMIN TOP BAR ============ */
.admin-top-bar {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 8px 0;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.admin-top-bar a {
    color: white;
    margin: 0 12px;
    padding: 3px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.admin-top-bar a:hover {
    background: rgba(255,255,255,0.2);
}

.badge-admin {
    background: white;
    color: #ee5a24;
    border-radius: 50%;
    padding: 1px 7px;
    font-size: 0.7rem;
    margin-left: 4px;
}

/* ============ HEADER ============ */
.main-header {
    background: linear-gradient(135deg, #0a192f 0%, #112240 100%);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.header-top {
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 900;
    background: linear-gradient(135deg, #64ffda, #48c6ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

/* Search */
.search-bar {
    flex: 1;
    display: flex;
    max-width: 520px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.5;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid transparent;
    border-radius: 12px 0 0 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(255,255,255,0.95);
    outline: none;
    transition: all 0.3s;
}

.search-bar input:focus {
    background: white;
    border-color: #64ffda;
    box-shadow: 0 0 0 3px rgba(100,255,218,0.2);
}

.search-bar button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #64ffda, #48c6ef);
    border: none;
    border-radius: 0 12px 12px 0;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    color: #0a192f;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-bar button:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.7);
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
}

.nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.08);
}

.nav-icon {
    font-size: 1.1rem;
}

.nav-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.15);
    margin: 0 4px;
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff4757;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(255,71,87,0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* User dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 6px 14px 6px 6px;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s;
}

.user-dropdown-btn:hover {
    background: rgba(255,255,255,0.14);
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64ffda, #48c6ef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    color: #0a192f;
}

.admin-badge {
    background: #ff6b6b;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 220px;
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 100;
}

.user-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #333;
    transition: background 0.15s;
}

.dropdown-menu a:hover {
    background: #f0f2f5;
}

.dropdown-danger {
    color: #ff4757 !important;
}

.dropdown-divider {
    height: 1px;
    background: #eee;
    margin: 4px 8px;
}

/* ============ BUTTONS ============ */
.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #64ffda, #48c6ef);
    color: #0a192f;
    box-shadow: 0 4px 15px rgba(100,255,218,0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(100,255,218,0.4);
    filter: brightness(1.05);
}

.btn-glow {
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 4px 15px rgba(100,255,218,0.3); }
    to { box-shadow: 0 4px 25px rgba(100,255,218,0.5); }
}

.btn-secondary {
    background: white;
    color: #0a192f;
    border: 2px solid #e0e4e8;
}

.btn-secondary:hover {
    border-color: #0a192f;
    background: #f8f9fa;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(238,90,36,0.3);
}

.btn-success {
    background: linear-gradient(135deg, #2ed573, #17c0eb);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffa502, #ff6348);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.05rem;
}

.btn-favorite {
    background: white;
    border: 2px solid #ff4757;
    color: #ff4757;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-favorite:hover,
.btn-favorite.active {
    background: #ff4757;
    color: white;
    transform: scale(1.02);
}

/* ============ MAIN CONTENT ============ */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 32px 24px;
}

/* ============ CATEGORIES ============ */
.categories-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0 20px;
    scrollbar-width: none;
}

.categories-bar::-webkit-scrollbar {
    display: none;
}

.category-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 2px solid #e8ecf0;
    border-radius: 50px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.category-chip:hover {
    border-color: #64ffda;
    background: #e8fffe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100,255,218,0.15);
}

.category-chip.active {
    border-color: #64ffda;
    background: linear-gradient(135deg, #e8fffe, #dff9fb);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(100,255,218,0.2);
}

/* ============ LISTINGS GRID ============ */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
}

.listing-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    border: 1px solid rgba(0,0,0,0.04);
}

.listing-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12);
}

.listing-card .image-wrapper {
    width: 100%;
    height: 210px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa, #e8ecf0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.listing-card .image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.listing-card:hover .image-wrapper img {
    transform: scale(1.06);
}

.listing-card .no-image {
    font-size: 3.5rem;
    opacity: 0.3;
}

.listing-card .card-body {
    padding: 18px;
}

.listing-card .price {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0a192f;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.listing-card .price .negotiable {
    font-size: 0.7rem;
    color: #888;
    font-weight: 400;
    background: #f0f2f5;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

.listing-card .title {
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;
    line-height: 1.4;
}

.listing-card .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: #999;
    font-weight: 500;
}

/* Condition badges */
.condition-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 2;
}

.condition-nowe {
    background: linear-gradient(135deg, #2ed573, #17c0eb);
}
.condition-używane {
    background: linear-gradient(135deg, #ffa502, #ff6348);
    color: white;
}
.condition-uszkodzone {
    background: linear-gradient(135deg, #ff4757, #c0392b);
}

/* ============ LISTING DETAIL ============ */
.listing-detail {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 28px;
}

.listing-images {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.listing-images .main-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    background: #fafafa;
}

.listing-images .no-image-large {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    background: linear-gradient(135deg, #f5f7fa, #e8ecf0);
    opacity: 0.4;
}

.thumbnails {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fafafa;
}

.thumbnails img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.thumbnails img:hover,
.thumbnails img.active {
    border-color: #64ffda;
    transform: scale(1.05);
}

.listing-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.info-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
}

.info-card .detail-price {
    font-size: 2.2rem;
    font-weight: 900;
    color: #0a192f;
    letter-spacing: -0.5px;
}

.info-card .detail-title {
    font-size: 1.3rem;
    margin-top: 10px;
    color: #333;
    font-weight: 600;
    line-height: 1.4;
}

.info-card .detail-meta {
    margin-top: 14px;
    color: #666;
    font-size: 0.88rem;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.detail-description {
    white-space: pre-wrap;
    line-height: 1.8;
    color: #444;
    font-size: 0.95rem;
}

.seller-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.seller-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #64ffda, #48c6ef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #0a192f;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(100,255,218,0.3);
}

.seller-info h3 {
    font-size: 1.05rem;
    color: #0a192f;
    font-weight: 700;
}

.seller-info p {
    font-size: 0.82rem;
    color: #888;
}

/* ============ FORMS ============ */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.form-card {
    background: white;
    border-radius: 20px;
    padding: 44px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
}

.form-card h1 {
    text-align: center;
    margin-bottom: 32px;
    color: #0a192f;
    font-size: 1.6rem;
    font-weight: 800;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8ecf0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.25s;
    background: #fafbfc;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #64ffda;
    background: white;
    box-shadow: 0 0 0 3px rgba(100,255,218,0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}

.form-group .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #64ffda;
}

.form-group .help-text {
    font-size: 0.78rem;
    color: #999;
    margin-top: 6px;
}

/* ============ ALERTS ============ */
.alert {
    padding: 16px 22px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 0.92rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* ============ SECTION HEADERS ============ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.section-header h1 {
    font-size: 1.7rem;
    color: #0a192f;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.section-header h1 small {
    font-weight: 400;
    color: #999;
    font-size: 0.75rem;
    margin-left: 8px;
}

/* ============ TABLES ============ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.data-table th {
    background: linear-gradient(135deg, #0a192f, #112240);
    color: white;
    padding: 16px 18px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.9rem;
}

.data-table tr:hover {
    background: #f8f9ff;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Alias */
.my-listings-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.my-listings-table th {
    background: linear-gradient(135deg, #0a192f, #112240);
    color: white;
    padding: 16px 18px;
    text-align: left;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.my-listings-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.9rem;
}

.my-listings-table tr:hover {
    background: #f8f9ff;
}

.listing-mini {
    display: flex;
    align-items: center;
    gap: 12px;
}

.listing-mini img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 10px;
}

.status-active {
    color: #2ed573;
    font-weight: 700;
}

.status-inactive {
    color: #ff4757;
    font-weight: 700;
}

/* ============ MESSAGES ============ */
.messages-container {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    height: 520px;
}

.conversations-list {
    background: white;
    border-radius: 16px;
    overflow-y: auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.conversation-item {
    padding: 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 12px;
    align-items: center;
}

.conversation-item:hover {
    background: #f8f9ff;
}

.conversation-item.active {
    background: linear-gradient(135deg, #e8fffe, #dff9fb);
    border-left: 3px solid #64ffda;
}

.conversation-item.unread {
    background: #f0fffe;
    font-weight: 600;
}

.chat-area {
    max-height: 520px !important;
    overflow: auto !important;
}

.chat-messages {
    overflow-y: auto !important;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 18px;
    border-radius: 18px;
    margin-bottom: 10px;
    font-size: 0.92rem;
    line-height: 1.5;
}

.message-bubble.sent {
    background: linear-gradient(135deg, #64ffda, #48c6ef);
    color: #0a192f;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.message-bubble.received {
    background: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 6px;
}

.message-bubble .time {
    font-size: 0.68rem;
    opacity: 0.6;
    margin-top: 4px;
}

.chat-input {
    padding: 16px;
    border-top: 1px solid #f0f2f5;
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #e8ecf0;
    border-radius: 50px;
    outline: none;
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.chat-input input:focus {
    border-color: #64ffda;
}

.chat-input button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #64ffda, #48c6ef);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 700;
    font-family: inherit;
    color: #0a192f;
    transition: all 0.2s;
}

.chat-input button:hover {
    transform: scale(1.05);
}

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
}

.pagination a,
.pagination span {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    border: 2px solid #e8ecf0;
    background: white;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #e8fffe;
    border-color: #64ffda;
    transform: translateY(-2px);
}

.pagination .current {
    background: linear-gradient(135deg, #0a192f, #112240);
    color: white;
    border-color: transparent;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 70px 20px;
    color: #888;
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 16px;
    filter: grayscale(0.3);
}

.empty-state h2 {
    margin-bottom: 8px;
    color: #555;
    font-size: 1.3rem;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 400px;
    margin: 0 auto;
}

/* ============ FILTERS BAR ============ */
.filters-bar {
    background: white;
    padding: 22px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filters-bar .form-group {
    margin-bottom: 0;
    min-width: 140px;
}

.filters-bar select,
.filters-bar input {
    padding: 9px 14px;
    font-size: 0.88rem;
}

/* ============ ADMIN PANEL ============ */
.admin-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-bottom: 36px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card .stat-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.stat-card .stat-number {
    font-size: 2.4rem;
    font-weight: 900;
    color: #0a192f;
    letter-spacing: -1px;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
    margin-top: 4px;
}

.admin-section {
    background: white;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.admin-section h2 {
    font-size: 1.2rem;
    color: #0a192f;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f2f5;
}

.user-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-banned {
    background: #f8d7da;
    color: #721c24;
}

.badge-admin-role {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.badge-user-role {
    background: #e8ecf0;
    color: #666;
}

/* ============ FOOTER ============ */
.main-footer {
    background: linear-gradient(135deg, #0a192f 0%, #112240 100%);
    color: rgba(255,255,255,0.6);
    padding: 50px 0 0;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h3 {
    color: #64ffda;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.footer-col h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 14px;
    font-weight: 700;
}

.footer-col p {
    font-size: 0.88rem;
    line-height: 1.7;
}

.footer-col a {
    display: block;
    padding: 5px 0;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.footer-col a:hover {
    color: #64ffda;
    padding-left: 6px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    text-align: center;
    font-size: 0.82rem;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 12px;
    }

    .search-bar {
        width: 100%;
        max-width: none;
    }

    .main-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-text {
        display: none;
    }

    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .listing-detail {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 28px 22px;
    }

    .messages-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .admin-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-bar {
        flex-direction: column;
    }

    .admin-top-bar {
        font-size: 0.75rem;
    }

    .admin-top-bar a {
        margin: 0 6px;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th, .data-table td {
        padding: 10px 12px;
    }
    /* ============ SMART SEARCH DROPDOWN ============ */
.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.15s;
    z-index: 200;
}

.search-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.suggest-section {
    padding: 6px 0;
    border-bottom: 1px solid #f0f2f5;
}

.suggest-label {
    padding: 6px 14px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggest-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    transition: background 0.1s;
    cursor: pointer;
    color: #333;
}

.suggest-item:hover { background: #f5f7fa; }

.suggest-category {
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 500;
}

.suggest-count {
    font-size: 0.75rem;
    color: #aaa;
}

.suggest-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.suggest-no-img {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    font-size: 1.1rem;
}

.suggest-info { flex: 1; min-width: 0; }

.suggest-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0f1923;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggest-meta {
    font-size: 0.75rem;
    color: #999;
    margin-top: 1px;
}

.suggest-more {
    display: block;
    padding: 12px 14px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64ffda;
    background: #fafbfc;
    border-radius: 0 0 10px 10px;
    transition: background 0.1s;
}

.suggest-more:hover { background: #f0fffe; }

.suggest-empty {
    padding: 24px 14px;
    text-align: center;
    color: #999;
    font-size: 0.88rem;
}

.suggest-empty span {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 6px;
}

/* ============ INFINITE SCROLL SPINNER ============ */
.scroll-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e3e8;
    border-top-color: #64ffda;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
.btn-add-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #00b894;
    color: white !important;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 4px;
    text-decoration: none;
}

.btn-add-nav:hover {
    background: #00a381;
    color: white !important;
    transform: translateY(-1px);
}
   
/* ============ RESPONSIVE — TELEFON + TABLET ============ */

/* TABLET (do 900px) */
@media (max-width: 900px) {
    .header-top {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 0;
        gap: 8px;
    }

    .search-wrapper,
    .search-bar {
        order: 3;
        max-width: none;
        width: 100%;
    }

    .main-nav {
        order: 2;
        gap: 2px;
    }

    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }

    .listing-card .image-wrapper { height: 160px; }

    .listing-detail {
        grid-template-columns: 1fr;
    }

    .messages-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .conversations-list {
        max-height: 300px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .admin-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters-bar {
        flex-direction: column;
    }

    .form-card {
        padding: 24px 18px;
    }
}

/* TELEFON (do 600px) */
@media (max-width: 600px) {

    /* Container mniejszy padding */
    .container {
        padding: 0 12px;
    }

    .main-content {
        padding: 16px 12px;
    }

    /* Header na telefonie */
    .header-top {
        padding: 8px 0;
        gap: 6px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .logo-icon {
        font-size: 1.1rem;
    }

    /* Chowaj tekst w nawigacji — zostaw same ikonki */
    .nav-text {
        display: none;
    }

    .nav-link {
        padding: 6px 8px;
    }

    .nav-icon {
        font-size: 1.1rem;
    }

    /* Przycisk dodaj — krótszy */
    .btn-add-nav {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .btn-add-nav span {
        display: none;
    }

    /* User dropdown mniejszy */
    .user-dropdown-btn {
        padding: 3px 8px 3px 3px;
        font-size: 0.75rem;
    }

    .user-avatar-small {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }

    .admin-badge {
        font-size: 0.5rem;
        padding: 1px 4px;
    }

    .nav-divider {
        height: 16px;
    }

    /* Search pełna szerokość */
    .search-bar {
        height: 36px;
    }

    .search-bar input {
        font-size: 0.85rem;
        padding-left: 30px;
    }

    .search-icon {
        font-size: 0.75rem;
        left: 8px;
    }

    .search-bar button {
        padding: 0 12px;
        font-size: 0.78rem;
    }

    /* Search dropdown na telefonie */
    .search-dropdown {
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        max-height: 70vh;
        border-radius: 12px;
    }

    /* Ogłoszenia — 2 kolumny na telefonie */
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .listing-card {
        border-radius: 10px;
    }

    .listing-card .image-wrapper {
        height: 130px;
    }

    .listing-card .card-body {
        padding: 10px;
    }

    .listing-card .price {
        font-size: 0.95rem;
    }

    .listing-card .title {
        font-size: 0.78rem;
        -webkit-line-clamp: 1;
        margin-bottom: 6px;
    }

    .listing-card .meta {
        font-size: 0.65rem;
    }

    .listing-card .negotiable {
        display: none;
    }

    .condition-badge {
        font-size: 0.55rem;
        padding: 2px 6px;
        top: 6px;
        left: 6px;
    }

    /* Szczegóły ogłoszenia */
    .listing-detail {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .info-card {
        padding: 16px;
    }

    .info-card .detail-price {
        font-size: 1.5rem;
    }

    .info-card .detail-title {
        font-size: 1.05rem;
    }

    .info-card .detail-meta {
        font-size: 0.8rem;
        gap: 8px;
    }

    .seller-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .thumbnails img {
        width: 60px;
        height: 60px;
    }

    /* Kategorie — scrollowalne */
    .categories-bar {
        gap: 6px;
        padding: 4px 0 14px;
    }

    .category-chip {
        padding: 6px 12px;
        font-size: 0.75rem;
        border-radius: 16px;
    }

    /* Sekcja header */
    .section-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .section-header h1 {
        font-size: 1.15rem;
    }

    /* Formularze */
    .form-container {
        max-width: 100%;
    }

    .form-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

    .form-card h1 {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .form-group label {
        font-size: 0.82rem;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 0.92rem;
    }

    /* Wiadomości */
    .messages-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 12px;
    }

    .conversations-list {
        max-height: 250px;
        border-radius: 10px;
    }

    .conversation-item {
        padding: 12px;
    }

    .chat-area {
        min-height: 350px;
        border-radius: 10px;
    }

    .chat-messages {
        padding: 14px;
    }

    .message-bubble {
        max-width: 85%;
        font-size: 0.85rem;
        padding: 8px 14px;
    }

    .chat-input {
        padding: 10px;
        gap: 6px;
    }

    .chat-input input {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .chat-input button {
        padding: 8px 16px;
        font-size: 0.82rem;
    }

    /* Tabele */
    .data-table,
    .my-listings-table {
        font-size: 0.75rem;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .data-table th,
    .data-table td,
    .my-listings-table th,
    .my-listings-table td {
        padding: 8px 8px;
    }

    .listing-mini img {
        width: 40px;
        height: 40px;
    }

    /* Admin */
    .admin-top-bar {
        font-size: 0.65rem;
        padding: 4px 0;
    }

    .admin-top-bar a {
        padding: 2px 4px;
        margin: 0 1px;
    }

    .admin-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-number {
        font-size: 1.4rem;
    }

    .stat-card .stat-icon {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .admin-section {
        padding: 16px;
    }

    .admin-section h2 {
        font-size: 0.95rem;
    }

    /* Alerty */
    .alert {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    /* Pagination */
    .pagination {
        gap: 3px;
    }

    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 16px;
    }

    .empty-state .icon {
        font-size: 2.5rem;
    }

    .empty-state h2 {
        font-size: 1rem;
    }

    /* Filtry */
    .filters-bar {
        padding: 12px;
        gap: 8px;
    }

    /* Dropdown menu */
    .dropdown-menu {
        min-width: 170px;
    }

    .dropdown-menu a {
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    /* Footer */
    .main-footer {
        padding: 28px 0 0;
        margin-top: 30px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding-bottom: 20px;
    }

    .footer-col h3 {
        font-size: 0.95rem;
    }

    .footer-col h4 {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .footer-col p,
    .footer-col a {
        font-size: 0.78rem;
    }

    .footer-bottom {
        padding: 14px 0;
        font-size: 0.7rem;
    }

    /* Buttony mniejsze */
    .btn {
        padding: 8px 16px;
        font-size: 0.82rem;
    }

    .btn-sm {
        padding: 4px 10px;
        font-size: 0.72rem;
    }

    .btn-favorite {
        padding: 8px 14px;
        font-size: 0.82rem;
    }

    /* Smart search podpowiedzi */
    .suggest-item {
        padding: 8px 12px;
    }

    .suggest-img {
        width: 38px;
        height: 38px;
    }

    .suggest-title {
        font-size: 0.8rem;
    }

    .suggest-meta {
        font-size: 0.7rem;
    }
}

/* ========================== */
/* MAŁY TELEFON (do 380px) */
/* ========================== */
@media (max-width: 380px) {
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .listing-card .image-wrapper {
        height: 100px;
    }

    .listing-card .card-body {
        padding: 8px;
    }

    .listing-card .price {
        font-size: 0.82rem;
    }

    .listing-card .title {
        font-size: 0.72rem;
    }

    .listing-card .meta {
        display: none;
    }

    .admin-dashboard {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .header-top {
        gap: 4px;
    }

    .logo-text {
        font-size: 0.9rem;
    }
}

/* ===================================================== */
/* PRZYCISK "DODAJ" – ZABIJAMY WSZYSTKIE NADPISANIA     */
/* ===================================================== */

.btn-add-nav {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;           /* biały tekst */
    background: #00b894 !important;    /* zielone tło */
    border: 1px solid #00a381 !important;
    z-index: 999 !important;           /* na wierzchu wszystkiego */
    position: relative !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    mix-blend-mode: normal !important;
    opacity: 1 !important;
    
}

