* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    padding: 10px 0px 20px 0px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn:hover {
    background: #0056b3;
}

.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.search-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.search-buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ad-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.ad-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.ad-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.ad-content {
    padding: 15px;
}

.ad-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.ad-price {
    font-size: 20px;
    color: #28a745;
    font-weight: bold;
    margin-bottom: 10px;
}

.ad-old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.ad-category {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.ad-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.ad-actions .btn {
    flex: 1;
    text-align: center;
    padding: 8px;
}

.no-ads {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    color: #666;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Стили для просмотра объявления */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.view-actions {
    display: flex;
    gap: 10px;
}

.gallery {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.main-image {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    margin-bottom: 20px;
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.thumbnail:hover {
    border-color: #007bff;
}

.view-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.price-section {
    margin-bottom: 20px;
}

.current-price {
    font-size: 32px;
    color: #28a745;
    font-weight: bold;
}

.old-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
    margin-left: 15px;
}

.details {
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.details p {
    margin: 10px 0;
}

.description h3 {
    margin-bottom: 10px;
    color: #333;
}

.description p {
    line-height: 1.6;
    color: #666;
}

/* Стили для удаления */
.delete-confirm {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.delete-confirm p {
    margin: 20px 0;
    font-size: 18px;
}

header div.header_block{
    left: auto;
    margin: 0px auto;
}