/* Reset default margins and padding */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global body styling */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    background-color: #f4f7fa;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header styling */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
}

header h1 {
    font-size: 2rem;
    color: #2c3e50;
}

/* Navigation */
nav {
    margin-top: 10px;
}

nav a, nav p {
    font-size: 0.9rem;
}

/* Main content container */
main, .container {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 90%;
}

/* Centered main content (login, register, admin forms) */
main.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

/* Admin form (add_item.php, edit_item.php) */
.admin-form {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 500px;
    transition: transform 0.3s ease;
}

.admin-form:hover {
    transform: translateY(-3px);
}

.admin-form .form-label {
    font-size: 0.9rem;
    color: #2c3e50;
}

.admin-form .form-control {
    border: 1px solid #ced4da;
    border-radius: 5px;
    padding: 10px;
    font-size: 0.9rem;
}

.admin-form .btn {
    padding: 10px;
    font-size: 1rem;
    border-radius: 5px;
}

/* Size options container */
.size-options {
    margin-bottom: 20px;
}

.size-options .mb-3 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.size-options .form-label {
    flex: 0 0 60px;
    margin-bottom: 0;
}

.size-options .form-control {
    flex: 1;
}

/* Item grid (index.php) */
.item-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

/* Item card (index.php) */
.item-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 150px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.item-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Item image */
.item-image {
    width: 100%;
    max-width: 200px;
    height: 100px;
    object-fit: cover;
}

/* Placeholder for no image */
.item-placeholder {
    width: 100%;
    max-width: 200px;
    height: 100px;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.8rem;
}

/* Item content */
.item-content {
    padding: 10px;
}

/* Item title */
.item-title {
    font-size: 0.9rem;
    margin-bottom: 5px;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Item price */
.item-price {
    font-size: 0.85rem;
    font-weight: bold;
    color: #28a745;
    margin-bottom: 5px;
}

/* Item stock */
.item-stock {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 5px;
}

/* Item form specific */
.item-form .form-select,
.item-form .form-control {
    font-size: 0.75rem;
    padding: 4px;
}

.item-form .btn {
    margin-top: 5px;
    font-size: 0.75rem;
    padding: 4px;
}

/* Table styling (admin/index.php, cart.php) */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background-color: #007bff;
    color: #fff;
    font-weight: 600;
}

td img {
    max-width: 50px;
    height: auto;
}

/* Nested table for order details */
.table-bordered {
    margin: 10px 0;
    box-shadow: none; /* Avoid double shadow */
}

.table-bordered th {
    background-color: #f1f3f5; /* Lighter header for nested table */
    color: #2c3e50;
}

.table-bordered td, .table-bordered th {
    padding: 8px;
}

/* Collapse styling */
.collapse {
    background-color: #f8f9fa; /* Light background for contrast */
}

/* Links */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

/* Buttons */
.btn-sm {
    font-size: 0.85rem;
    padding: 5px 10px;
}

/* Headings */
h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .item-card {
        width: 120px;
    }
    .item-image, .item-placeholder {
        height: 80px;
    }
    .item-title {
        font-size: 0.8rem;
    }
    .item-price, .item-stock {
        font-size: 0.7rem;
    }
    .item-form .form-select,
    .item-form .form-control,
    .item-form .btn {
        font-size: 0.7rem;
    }
    .admin-form {
        max-width: 100%;
        padding: 15px;
    }
    .size-options .form-label {
        flex: 0 0 50px;
    }
    header h1 {
        font-size: 1.5rem;
    }
    th, td {
        font-size: 0.85rem;
        padding: 8px;
    }
    .table-bordered th, .table-bordered td {
        font-size: 0.75rem;
        padding: 6px;
    }
}