/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f4f9;
    margin: 0;
    padding: 20px;
}

/* General Container Styles */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header Styles - Fixed */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    color: white;
    margin: 0;
    font-size: 24px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Button Styles */
.button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    color: white;
    background: #4CAF50;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
    min-width: 120px;
}

.button:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.button-danger {
    background: #dc3545;
}

.button-danger:hover {
    background: #c82333;
}

/* Table Styles */
.product-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
}

.product-table th,
.product-table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.product-table th {
    background: #f8f9fa;
    position: sticky;
    top: 70px;
}

.product-img {
    max-width: 100px;
    height: auto;
    object-fit: contain;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input,
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

textarea {
    height: 150px;
    resize: vertical;
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-container h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #232f3e;
}

/* Error Message */
.error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
}

/* Submit Button */
button[type="submit"] {
    width: 100%;
    padding: 10px;
    background: #4CAF50;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
    background: #45a049;
}

/* Category Filter */
.category-filter {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-filter select {
    flex: 1;
    max-width: 300px;
}

.category-filter button {
    min-width: 100px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .container {
        padding: 15px;
    }

    .header {
        padding: 12px;
    }

    .product-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
    }

    .header h1 {
        text-align: center;
    }

    .header-buttons {
        justify-content: center;
    }

    .button {
        width: calc(50% - 5px);
        min-width: unset;
    }

    .category-filter {
        flex-direction: column;
    }

    .category-filter select {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .header-buttons {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }

    .product-table th,
    .product-table td {
        padding: 8px;
        font-size: 14px;
    }

    .product-img {
        max-width: 60px;
    }
}

/* Preview Image */
.preview img {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 10px 0;
}

/* Action Buttons */
.actions {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.edit-btn,
.delete-btn {
    padding: 6px 12px;
    border-radius: 4px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

.edit-btn {
    background: #ffc107;
}

.edit-btn:hover {
    background: #e0a800;
}

.delete-btn {
    background: #dc3545;
}

.delete-btn:hover {
    background: #c82333;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.product {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease-in-out;
    background: white;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product:hover {
    transform: scale(1.05);
}

.product-image {
    height: 200px;
    margin-bottom: 15px;
}

.product-image img {
    max-width: 100%;
    height: 100%;
    border-radius: 5px;
    object-fit: contain;
}

.product-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.details-button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
    width: 100%;
    max-width: 200px;
    text-align: center;
}

.details-button:hover {
    background-color: #45a049;
}

.qr-code {
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.qr-code img {
    width: 100%;
    height: 100%;
    display: block;
    background: white;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
}
/* Footer Styles */
footer {
    background: #232f3e;
    color: white;
    padding: 40px 20px;
    margin-top: auto;
    width: 100%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    width: 100%;
}

.footer-disclaimer {
    margin-bottom: 20px;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.footer-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.footer-copyright {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.version-info {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 5px;
}

@media (max-width: 768px) {
    .footer-content {
        padding: 0 20px;
    }
}