/* General Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

nav {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
    background-color: rgba(255, 255, 255, 0.1);
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Search Bar */
.search-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.search-container input {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* Items Container */
.items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.item-card {
    background-color: 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;
}

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

.item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.item-info {
    padding: 1.2rem;
}

.item-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.item-info p {
    margin: 0.3rem 0;
    color: #666;
}

.item-info small {
    display: block;
    margin: 0.5rem 0;
    color: #999;
    font-size: 0.8rem;
}

.no-items {
    text-align: center;
    color: #777;
    font-size: 1.2rem;
    margin-top: 2rem;
    grid-column: 1 / -1;
}

/* Item Actions */
.item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.view-btn, .edit-btn, .delete-btn {
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.view-btn {
    background-color: #3498db;
    color: white;
}

.view-btn:hover {
    background-color: #2980b9;
}

.edit-btn {
    background-color: #f39c12;
    color: white;
}

.edit-btn:hover {
    background-color: #e67e22;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
}

/* Form Styles */
.item-form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
}

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

.form-group input[type="file"] {
    padding: 0.5rem;
    border: 1px dashed #ddd;
    border-radius: 4px;
    width: 100%;
}

/* Image Previews */
.image-preview-container {
    margin-top: 1rem;
}

#coverImagePreview {
    max-width: 100%;
    max-height: 200px;
    display: none;
    margin-top: 1rem;
    border-radius: 4px;
}

#additionalImagesPreview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.additional-image-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.submit-btn {
    background-color: #2c3e50;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.submit-btn:hover {
    background-color: #34495e;
}

.success-message {
    background-color: #2ecc71;
    color: white;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    margin-top: 1rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-btn {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #777;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.item-details {
    display: flex;
    gap: 2rem;
}

.item-details-image {
    flex: 1;
    min-width: 300px;
}

.item-details-image img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
}

.item-details-info {
    flex: 1;
}

.item-details-info p {
    margin: 0.5rem 0;
}

.item-details-info strong {
    color: #2c3e50;
}

/* Carousel Styles */
.carousel {
    position: relative;
    margin-top: 1.5rem;
    overflow: hidden;
    border-radius: 4px;
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
}

.carousel-item img {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
}

.carousel-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
}

.carousel-control {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 50%;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.carousel-control:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Message notifications */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 5px;
    color: white;
    z-index: 1000;
    transition: opacity 0.5s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.message.info {
    background-color: #3498db;
}

.message.success {
    background-color: #2ecc71;
}

.message.error {
    background-color: #e74c3c;
}

.message.fade-out {
    opacity: 0;
}
/* ITEM CARD STYLES */
.item-card {
    background-color: 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;
}

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

.item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f0f0f0;
    border-bottom: 1px solid #eee;
}

.item-info {
    padding: 1.2rem;
}

.item-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.item-info p {
    margin: 0.3rem 0;
    color: #666;
}

.item-info .item-type {
    font-weight: bold;
    color: #3498db;
}

.item-info .item-description {
    margin: 0.8rem 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.5;
}

.item-info small {
    display: block;
    margin-top: 0.8rem;
    color: #999;
    font-size: 0.8rem;
}

/* NO ITEMS MESSAGE */
.no-items {
    text-align: center;
    color: #777;
    font-size: 1.2rem;
    margin-top: 2rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.no-items a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.no-items a:hover {
    text-decoration: underline;
}

/* SEARCH STYLES */
.search-container {
    margin-bottom: 2rem;
    display: flex;
    gap: 0.5rem;
}

.search-container input {
    flex: 1;
    max-width: 500px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-container button {
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 1rem;
    cursor: pointer;
}

/* ITEMS CONTAINER */
.items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 768px) {
    .items-container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 480px) {
    .items-container {
        grid-template-columns: 1fr;
    }
    
    .item-info {
        padding: 1rem;
    }
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

/* Header Styles */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

nav a {
    color: white;
    text-decoration: none;
    margin-right: 15px;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: rgba(255,255,255,0.1);
}

nav a.active {
    background-color: rgba(255,255,255,0.2);
}

/* Search Styles */
.search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-container input {
    padding: 10px;
    flex: 1;
    max-width: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-container button {
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 15px;
    cursor: pointer;
}

/* Items Container */
.items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Item Card Styles */
.item-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

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

.item-info {
    padding: 15px;
}

.item-info h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
}

.item-info p {
    margin: 5px 0;
    color: #666;
}

.item-info small {
    color: #999;
    font-size: 0.8em;
}

/* Loading Message */
.loading-message {
    text-align: center;
    padding: 30px;
    color: #666;
    grid-column: 1 / -1;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .items-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .items-container {
        grid-template-columns: 1fr;
    }
    
    header {
        text-align: center;
    }
    
    nav {
        display: flex;
        justify-content: center;
    }
}
