* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #1a2a3a;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: linear-gradient(135deg, #1e3c72, #2b4c7c);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

header h1 {
    font-size: 1.8rem;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    background: rgba(255,255,255,0.2);
    padding: 8px 15px;
    border-radius: 25px;
    transition: 0.3s;
    display: inline-block;
    margin-top: 5px;
}

nav a:hover {
    background: rgba(255,255,255,0.4);
}

.search-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-bar form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-bar input, .search-bar select, .search-bar button {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

.search-bar input {
    flex: 2;
    min-width: 200px;
}

.search-bar select {
    flex: 1;
}

.search-bar button {
    background: #2b4c7c;
    color: white;
    border: none;
    cursor: pointer;
}

.reset {
    background: #aaa;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
}

.listings h2 {
    margin-bottom: 20px;
}

.listing-card, .single-listing, .message-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.listing-header h3 a {
    color: #1e3c72;
    text-decoration: none;
}

.type {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
}

.type.sprzedam {
    background: #d4edda;
    color: #155724;
}

.type.kupie {
    background: #fff3cd;
    color: #856404;
}

.category, .price, .user {
    display: inline-block;
    margin-right: 15px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.price {
    font-weight: bold;
    color: #2b4c7c;
}

.description {
    margin: 15px 0;
    color: #555;
}

.listing-footer {
    font-size: 0.8rem;
    color: #777;
    margin-top: 10px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.listing-actions {
    margin-top: 10px;
}

.btn-edit, .btn-delete {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 0.85rem;
    margin-right: 10px;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.listing-form, .auth-form {
    background: white;
    padding: 25px;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: inherit;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
}

.btn-submit {
    background: #2b4c7c;
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #2b4c7c;
    text-decoration: none;
}

.gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.gallery-img {
    max-width: 200px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.contact-box, .message-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.message-box textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.message-card {
    margin-bottom: 15px;
}

.message-card.unread {
    border-left: 4px solid #dc3545;
    background: #fff5f5;
}

.message-card.read {
    border-left: 4px solid #28a745;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.message-content {
    margin: 10px 0;
}

.profile-stats {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.stats-grid {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.stat-card {
    background: #f8f9fa;
    padding: 15px 25px;
    border-radius: 10px;
    text-align: center;
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2b4c7c;
}

.admin-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th, .admin-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background: #f0f2f5;
}

.admin-table button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.inline-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.inline-form input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    nav a {
        margin: 10px 5px;
        display: inline-block;
    }
    .stats-grid {
        flex-direction: column;
    }
    .admin-table {
        font-size: 0.8rem;
        overflow-x: auto;
        display: block;
    }
}
/* Formularz zmiany hasła */
.password-change-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.password-change-box h3 {
    margin-bottom: 20px;
    color: #1e3c72;
}

.password-form {
    max-width: 400px;
}

.password-form .form-group {
    margin-bottom: 15px;
}

.password-form input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
}
/* Paginacja */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0 15px 0;
}

.page-link, .page-current {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.page-link {
    background: #f0f2f5;
    color: #1e3c72;
    border: 1px solid #ddd;
}

.page-link:hover {
    background: #2b4c7c;
    color: white;
    border-color: #2b4c7c;
}

.page-current {
    background: #2b4c7c;
    color: white;
    border: 1px solid #2b4c7c;
    font-weight: bold;
}

.pagination-info {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
}