/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    padding-top: 70px; /* space for fixed header */
}

a {
    text-decoration: none;
    color: #0077b6;
}
a:hover {
    color: #023e8a;
}

/* ===== HEADER ===== */
header {
    background: #1a1a2e;
    color: #fff;
    padding: 12px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 26px;
    font-weight: 700;
    color: #fca311;
    letter-spacing: -0.5px;
}
.logo:hover {
    color: #ffb347;
}

nav a {
    color: #e0e0e0;
    margin-left: 18px;
    font-size: 15px;
    transition: color 0.2s;
}
nav a:hover {
    color: #fca311;
}
nav a:last-child {
    background: #fca311;
    color: #1a1a2e;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
}
nav a:last-child:hover {
    background: #ffb347;
}

/* ===== CONTAINERS ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== FORMS ===== */
.form-container {
    max-width: 540px;
    margin: 40px auto;
    background: #fff;
    padding: 35px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.form-container h2 {
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 600;
    color: #1a1a2e;
    border-bottom: 3px solid #fca311;
    padding-bottom: 10px;
    display: inline-block;
}

.form-container input,
.form-container textarea,
.form-container select {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0 16px 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 15px;
    background: #fafafa;
    transition: border 0.2s;
}
.form-container input:focus,
.form-container textarea:focus,
.form-container select:focus {
    border-color: #fca311;
    outline: none;
    background: #fff;
}
.form-container textarea {
    min-height: 100px;
    resize: vertical;
}

.form-container button,
.btn {
    background: #fca311;
    color: #1a1a2e;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: inline-block;
}
.form-container button:hover,
.btn:hover {
    background: #ffb347;
    transform: translateY(-2px);
}
.btn-secondary {
    background: #0077b6;
    color: #fff;
}
.btn-secondary:hover {
    background: #023e8a;
}

.form-container p {
    margin-top: 18px;
    font-size: 14px;
}
.form-container .error {
    color: #d62828;
    background: #ffe5e5;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}
.form-container .success {
    color: #2a9d8f;
    background: #e2f3f0;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

/* ===== SEARCH FORM ===== */
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: #fff;
    padding: 18px 22px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    margin: 20px 0 30px 0;
    align-items: center;
}
.search-form input[type="text"] {
    flex: 2;
    min-width: 200px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
}
.search-form select {
    flex: 1;
    min-width: 140px;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
}
.search-form button {
    padding: 10px 28px;
    background: #0077b6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.search-form button:hover {
    background: #023e8a;
}

/* ===== ITEMS GRID ===== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px;
    margin: 25px 0 40px 0;
}

.item-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.25s, box-shadow 0.25s;
    text-align: center;
    padding-bottom: 18px;
}
.item-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}
.item-card a {
    color: #1a1a2e;
    display: block;
}
.item-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f0f0f0;
}
.item-card h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 12px 10px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.item-card p {
    font-size: 18px;
    font-weight: 700;
    color: #fca311;
    margin: 4px 0;
}
.item-card small {
    color: #6c757d;
    font-size: 13px;
}

/* ===== ITEM DETAIL PAGE ===== */
.item-detail {
    background: #fff;
    padding: 35px 40px;
    border-radius: 14px;
    max-width: 850px;
    margin: 20px auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.item-detail img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    margin: 0 auto 20px;
    background: #f8f9fa;
}
.item-detail h1 {
    font-size: 30px;
    margin-bottom: 10px;
}
.item-detail p {
    margin: 8px 0;
}
.item-detail .btn {
    margin-top: 15px;
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    margin: 15px 0 30px;
}
table th {
    background: #1a1a2e;
    color: #fff;
    font-weight: 600;
    padding: 14px 16px;
    text-align: left;
}
table td {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}
table tr:last-child td {
    border-bottom: none;
}
table tr:hover td {
    background: #f8f9fa;
}
table .actions form {
    display: inline;
}

/* ===== ADMIN DASHBOARD ===== */
.admin-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin: 20px 0 30px;
}
.admin-stat {
    background: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex: 1;
    min-width: 150px;
    text-align: center;
}
.admin-stat h3 {
    font-size: 32px;
    color: #fca311;
}
.admin-stat p {
    color: #6c757d;
    font-weight: 500;
    margin-top: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
    .header-inner {
        flex-wrap: wrap;
        justify-content: center;
    }
    .logo {
        font-size: 22px;
    }
    nav {
        margin-top: 6px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 12px;
    }
    nav a {
        margin-left: 0;
        font-size: 14px;
    }
    nav a:last-child {
        padding: 4px 14px;
    }
    .form-container {
        padding: 25px 20px;
        margin: 20px 15px;
    }
    .items-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    .item-detail {
        padding: 20px;
        margin: 10px;
    }
    .search-form {
        flex-direction: column;
        align-items: stretch;
    }
    .search-form input,
    .search-form select,
    .search-form button {
        width: 100%;
    }
    table {
        font-size: 14px;
    }
    table th, table td {
        padding: 8px 10px;
    }
    .admin-stats {
        flex-direction: column;
        align-items: center;
    }
    .admin-stat {
        width: 100%;
        max-width: 300px;
    }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none; }