/* Resetowanie stylów */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

a {
    text-decoration: none;
    color: #2c3e50;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
}

/* Header */
header {
    background-color: #3498db;
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo a {
    color: #fff;
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #fff;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

nav ul li a:hover {
    opacity: 0.8;
}

/* Mobile menu */
.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #fff;
}

/* Sidebar */
.sidebar {
    width: 25%;
    padding-right: 20px;
}

.sidebar h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.categories-list li {
    margin-bottom: 10px;
}

.categories-list a {
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.categories-list a:hover {
    background-color: #ecf0f1;
}

/* Main content */
.content {
    width: 75%;
}

/* Hero section */
.hero {
    background-color: #2980b9;
    color: #fff;
    padding: 40px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #e74c3c;
    color: #fff;
}

.btn-primary:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Advertisements */
.recent-ads h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-gap: 20px;
}

.ad-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ad-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
}

.ad-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.ad-card:hover .ad-image img {
    transform: scale(1.05);
}

.no-image {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ecf0f1;
    color: #95a5a6;
}

.ad-info {
    padding: 15px;
}

.ad-info h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.ad-price {
    color: #e74c3c;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.ad-location, .ad-category, .ad-date {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.ad-location i, .ad-category i, .ad-date i {
    margin-right: 5px;
}

/* Advertisement detail */
.ad-detail {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ad-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.ad-detail-title {
    flex: 1;
}

.ad-detail-title h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.ad-detail-price {
    font-size: 1.8rem;
    color: #e74c3c;
    font-weight: 700;
}

.ad-detail-meta {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ad-detail-meta p {
    margin-right: 20px;
    margin-bottom: 10px;
    color: #7f8c8d;
}

.ad-detail-images {
    display: flex;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.ad-main-image {
    width: 100%;
    margin-bottom: 10px;
}

.ad-main-image {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.ad-main-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
}

.ad-thumbnails {
    display: flex;
    gap: 10px;
}

.ad-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    border: 1px solid #eee;
}

.ad-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.ad-thumbnail img:hover {
    opacity: 0.8;
}

.ad-detail-description {
    margin-bottom: 30px;
    line-height: 1.8;
}

.ad-detail-contact {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.ad-detail-contact h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
}

.contact-info p {
    margin-right: 20px;
    margin-bottom: 10px;
}

.contact-info i {
    margin-right: 5px;
    color: #3498db;
}

.current-image-item{
    width:90%;
    height:90%;
}

.image-preview{
    width:90%;
    height:90%;
}


/* Forms */
.form-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-title {
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

textarea.form-control {
    height: 150px;
    resize: vertical;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
}

.form-help {
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 40px 0;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.footer-column {
    width: 30%;
    margin-bottom: 20px;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #3498db;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #ecf0f1;
    transition: color 0.3s ease;
}

.footer-column ul li a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #34495e;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    text-align: center;
}

.modal:before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

.modal-content {
    display: inline-block;
    vertical-align: middle;
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    object-fit: contain;
    background-color: white;
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal.show .modal-content {
    opacity: 1;
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

/* Admin styles */
.admin-container {
    display: flex;
}

.admin-sidebar {
    width: 250px;
    background-color: #2c3e50;
    color: #ecf0f1;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    padding-top: 20px;
}

.admin-sidebar h2 {
    text-align: center;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #34495e;
}

.admin-sidebar ul li {
    margin-bottom: 5px;
}

.admin-sidebar ul li a {
    display: block;
    padding: 10px 20px;
    color: #ecf0f1;
    transition: background-color 0.3s ease;
}

.admin-sidebar ul li a:hover, .admin-sidebar ul li a.active {
    background-color: #34495e;
}

.admin-content {
    margin-left: 250px;
    padding: 20px;
    width: calc(100% - 250px);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.admin-header h1 {
    font-size: 1.8rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background-color: #f4f4f4;
    font-weight: 500;
}

.admin-table tr:hover {
    background-color: #f9f9f9;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.btn-edit {
    background-color: #3498db;
    color: #fff;
}

.btn-edit:hover {
    background-color: #2980b9;
}

.btn-delete {
    background-color: #e74c3c;
    color: #fff;
}

.btn-delete:hover {
    background-color: #c0392b;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 4px;
    background-color: #f4f4f4;
    transition: background-color 0.3s ease;
}

.pagination a:hover, .pagination a.active {
    background-color: #3498db;
    color: #fff;
}

/* Responsive styles */
@media (max-width: 992px) {
    .sidebar {
        width: 30%;
    }
    
    .content {
        width: 70%;
    }
    
    .footer-column {
        width: 48%;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        margin-bottom: 30px;
    }
    
    .content {
        width: 100%;
    }
    
    .ads-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .hamburger {
        display: block;
    }
    
    nav {
        position: fixed;
        top: 0;
        right: -300px;
        width: 300px;
        height: 100vh;
        background-color: #2c3e50;
        z-index: 1000;
        transition: right 0.3s ease;
        padding: 60px 20px 20px;
    }
    
    nav.active {
        right: 0;
    }
    
    nav ul {
        flex-direction: column;
    }
    
    nav ul li {
        margin: 0 0 20px 0;
    }
    
    .close-menu {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 1.5rem;
        color: #fff;
        cursor: pointer;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-content {
        margin-left: 0;
        width: 100%;
    }
    
    .footer-column {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .ads-grid {
        grid-template-columns: 1fr;
    }
    
    .ad-detail-header {
        flex-direction: column;
    }
    
    .ad-detail-price {
        margin-top: 10px;
    }
}

/* Image lightbox effect */
.thumbnail {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.thumbnail:hover {
    transform: scale(1.05);
}