/* QRStore Styles */

/* Navigation */
nav {
    margin-bottom: 20px;
}

nav a {
    margin-right: 15px;
    padding: 8px 16px;
    text-decoration: none;
    color: #007bff;
    border: 1px solid #007bff;
    border-radius: 4px;
    transition: all 0.3s;
}

nav a:hover, nav a.active {
    background-color: #007bff;
    color: white;
}

/* Grid layouts */
.categories-grid, .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.category-card, .product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.category-card:hover, .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-image, .product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.category-image img, .product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-info, .product-info {
    padding: 15px;
}

.category-info h3, .product-info h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.category-info p, .product-info p {
    color: #666;
    margin-bottom: 10px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.category {
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #495057;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}

.status.active {
    background-color: #d4edda;
    color: #155724;
}

.status.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

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

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

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

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

.btn-link {
    background: none;
    border: none;
    color: #007bff;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: #0056b3;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

/* Filters */
.filters {
    background: linear-gradient(135deg, #f7fafc 0%, #eef4f8 100%);
    border: 1px solid #d8e2ea;
    padding: 22px;
    border-radius: 18px;
    margin-bottom: 24px;
    box-shadow: 0 18px 40px rgba(26, 54, 93, 0.08);
}

.filters-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.filters-kicker {
    margin: 0 0 6px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5f7a8f;
    font-weight: 700;
}

.filters-head h2 {
    margin: 0;
    font-size: 1.35rem;
    color: #153047;
}

.filters-summary {
    display: flex;
    align-items: center;
}

.filters-summary span {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background-color: #ffffff;
    border: 1px solid #d8e2ea;
    color: #345066;
    font-weight: 600;
}

.filters-form {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 170px;
    flex: 0 0 170px;
}

.filter-group-search {
    min-width: 280px;
    flex-basis: 320px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #355065;
}

.filter-group input, .filter-group select {
    height: 46px;
    padding: 0 14px;
    border: 1px solid #c9d7e2;
    border-radius: 12px;
    min-width: 150px;
    background-color: #fff;
    color: #223645;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.filter-group input::placeholder {
    color: #8aa0b2;
}

.filter-group input:focus, .filter-group select:focus {
    outline: none;
    border-color: #2b7bbb;
    box-shadow: 0 0 0 4px rgba(43, 123, 187, 0.12);
    transform: translateY(-1px);
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    padding-top: 24px;
    flex: 0 0 auto;
}

.filter-actions .btn {
    min-width: 110px;
    height: 46px;
    border-radius: 12px;
    font-weight: 700;
}

.filter-actions .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    height: auto;
    padding: 0;
}

/* Tables */
.products-table, .categories-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.products-table th, .products-table td,
.categories-table th, .categories-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.products-table th, .categories-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.table-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}

.status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background-color: #f8d7da;
    color: #721c24;
}

.actions {
    white-space: nowrap;
}

.actions .btn {
    margin-right: 5px;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

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

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

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

.current-image {
    margin-bottom: 10px;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Admin actions */
.admin-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination span {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* No data */
.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .categories-grid, .products-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        padding: 18px;
        border-radius: 14px;
    }

    .filters-head {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-form {
        flex-direction: column;
        align-items: stretch;
        overflow-x: visible;
    }

    .filter-group,
    .filter-group-search {
        min-width: auto;
        flex: 1 1 auto;
    }

    .filter-actions {
        margin-left: 0;
        padding-top: 4px;
        justify-content: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
}
