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

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

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

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.admin-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.admin-btn:hover {
    background: #c0392b;
}

.oxygen-light {
  font-family: "Oxygen", sans-serif;
  font-weight: 300;
  font-style: normal;
}

.oxygen-regular {
  font-family: "Oxygen", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.oxygen-bold {
  font-family: "Oxygen", sans-serif;
  font-weight: 700;
  font-style: normal;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
}

.hero-content h1 {
    font-size: 4.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.categories, .items-section, .item-detail {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.categories h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.category-card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.category-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* Back Button Styles - Updated */
.back-btn {
    background: #2c3e50 !important; /* Footer color */
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background 0.3s ease, transform 0.2s ease;
    font-size: 1.1rem !important; /* Increased font size */
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: #34495e !important; /* Slightly lighter on hover */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Checkbox Group Styles */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.checkbox-label:hover {
    background: #e9ecef;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

/* reCAPTCHA Styles */
.g-recaptcha {
    margin: 15px 0;
    display: flex;
    justify-content: center;
}

/* reCAPTCHA responsive */
@media (max-width: 480px) {
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: 0 0;
    }
}

/* reCAPTCHA Error Message */
#recaptcha-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
    text-align: center;
    font-weight: bold;
}

/* Form group spacing for reCAPTCHA */
.form-group:has(.g-recaptcha) {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

/* Form Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Success Modal Enhancements */
.success-modal .modal-body {
    text-align: center;
}

.success-icon {
    font-size: 4rem;
    color: #27ae60;
    margin-bottom: 1rem;
}

.success-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Mobile Responsive for Checkboxes */
@media (max-width: 768px) {
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .success-actions .btn {
        width: 100%;
    }
}

/* Ensure all back buttons have consistent styling */
.section-header .back-btn,
.detail-header .back-btn,
.search-results .back-btn,
.admin-container .back-btn {
    background: #2c3e50 !important;
    color: white;
    font-size: 1.1rem;
    padding: 12px 24px;
}

/* Specific styling for back buttons in search results */
.search-results .btn[onclick*="showSearchForm"] {
    background: #2c3e50 !important;
    color: white;
    font-size: 1.1rem;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-results .btn[onclick*="showSearchForm"]:hover {
    background: #34495e !important;
}

/* Back button in standalone item detail page */
.admin-btn[onclick*="goBack"] {
    background: #2c3e50 !important;
    color: white;
    font-size: 1.1rem;
    padding: 10px 20px;
}

.admin-btn[onclick*="goBack"]:hover {
    background: #34495e !important;
}

/* Mobile responsive adjustments for back buttons */
@media (max-width: 768px) {
    .back-btn {
        font-size: 1.05rem !important;
        padding: 10px 20px;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .section-header .back-btn,
    .detail-header .back-btn {
        width: auto;
    }
}

/* Ensure consistency across all back navigation */
.btn[onclick*="Back"],
.btn[onclick*="back"],
button[onclick*="Back"],
button[onclick*="back"] {
    font-size: 1.1rem;
}

/* Specific targeting for back buttons with arrow */
button[onclick*="showCategories"],
button[onclick*="showItems"],
button[onclick*="showSearchForm"] {
    background: #2c3e50 !important;
    color: white !important;
    font-size: 1.1rem !important;
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 5px !important;
}

button[onclick*="showCategories"]:hover,
button[onclick*="showItems"]:hover,
button[onclick*="showSearchForm"]:hover {
    background: #34495e !important;
}

.items-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 2rem;
}

/* Reference Number Search Styling */
.search-ref-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin-bottom: 2rem;
}

.search-ref-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.search-ref-container input {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1px;
}

.search-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
}

.search-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

/* Contact Page Styles */
.contact-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.info-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #ecf0f1;
}

.info-section:last-of-type {
    border-bottom: none;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.feature-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.contact-section {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    margin: 2rem 0;
}

.contact-section h2 {
    margin-bottom: 1rem;
}

.contact-section .btn {
    background: white;
    color: #667eea;
    font-size: 1.1rem;
    padding: 15px 30px;
    margin-top: 1rem;
}

.contact-section .btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-number {
    background: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step p {
    margin: 0;
    line-height: 1.6;
}

.contact-details {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #27ae60;
}

.contact-info p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #ecf0f1;
    background: #f8f9fa;
    border-radius: 10px 10px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-modal:hover {
    background: #e74c3c;
    color: white;
}

.modal-form {
    padding: 2rem;
}

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

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

.modal-form input,
.modal-form select,
.modal-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
    border-color: #3498db;
    outline: none;
}

.modal-form textarea {
    height: 120px;
    resize: vertical;
}

.modal-form select[multiple] {
    height: 120px;
}

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

/* Success Modal */
.success-modal {
    text-align: center;
    max-width: 500px;
}

.success-modal .modal-body {
    padding: 2rem;
}

.success-icon {
    font-size: 4rem;
    color: #27ae60;
    margin-bottom: 1rem;
}

.success-modal h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.success-modal p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #7f8c8d;
}

.success-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Contact Navigation Button */
.contact-nav-btn {
    background: #9b59b6 !important;
    margin-right: 10px;
}

.contact-nav-btn:hover {
    background: #8e44ad !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-form {
        padding: 1.5rem;
    }
    
    .modal-form .form-actions {
        flex-direction: column;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .contact-section .btn {
        width: 100%;
    }
    
    .contact-nav-btn {
        margin-right: 0;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .contact-content {
        padding: 1rem;
    }
    
    .modal-form {
        padding: 1rem;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
}

/* Reference number input styling */
#itemId {
    background: #f8f9fa;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Existing Images Styling */
.existing-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.existing-image-item {
    text-align: center;
}

.image-preview {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 8px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 2px solid #e0e0e0;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.delete-image-btn:hover {
    opacity: 1;
    background: #c0392b;
}

.image-number {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 5px;
}

.image-actions {
    margin-top: 15px;
    text-align: center;
}

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

/* Item List Improvements */
.item-list-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.item-list-actions {
    display: flex;
    gap: 10px;
}

/* Form Button States */
.btn-primary[style*="display: none"] {
    display: none !important;
}

#updateBtn[style*="display: none"],
#deleteBtn[style*="display: none"] {
    display: none !important;
}

/* Mobile Responsive for Search */
@media (max-width: 768px) {
    .search-ref-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-ref-container .btn {
        width: 100%;
        margin-top: 10px;
    }
    
    .existing-images-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .image-preview {
        width: 100px;
        height: 100px;
    }
    
    .item-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .item-list-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Existing Images Styling */
.existing-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.existing-image-item {
    text-align: center;
}

.image-preview {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 8px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 2px solid #e0e0e0;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.delete-image-btn:hover {
    opacity: 1;
    background: #c0392b;
}

.image-number {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 5px;
}

.image-actions {
    margin-top: 15px;
    text-align: center;
}

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

/* Item List Improvements */
.item-list-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.item-list-actions {
    display: flex;
    gap: 10px;
}

/* Form Button States */
.btn-primary[style*="display: none"] {
    display: none !important;
}

#updateBtn[style*="display: none"],
#deleteBtn[style*="display: none"] {
    display: none !important;
}

/* File Input Styling */
.form-group input[type="file"] {
    padding: 8px;
    border: 2px dashed #3498db;
    background: #f8f9fa;
}

.form-group input[type="file"]:focus {
    border-color: #2980b9;
    outline: none;
}

/* Mobile Responsive for Image Management */
@media (max-width: 768px) {
    .existing-images-container {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .image-preview {
        width: 100px;
        height: 100px;
    }
    
    .item-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .item-list-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Success/Error Messages */
.alert {
    padding: 12px 16px;
    border-radius: 5px;
    margin: 10px 0;
    font-weight: bold;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

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

/* Mobile Actions Sticky Footer */
.mobile-actions {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 15px 0;
    margin-top: 20px;
    border-top: 2px solid #ecf0f1;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Standalone Item Detail Page */
.admin-container .detail-content {
    margin-top: 0;
}

/* Mobile Province Select Fix */
@media (max-width: 768px) {
    .admin-form {
        padding-bottom: 80px; /* Space for sticky buttons */
    }
    
    .mobile-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 15px 20px;
        border-top: 2px solid #ecf0f1;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100;
    }
    
    /* Auto-close select on mobile after selection */
    select:focus {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Back button styling */
.admin-btn[onclick*="goBack"] {
    background: #95a5a6;
}

.admin-btn[onclick*="goBack"]:hover {
    background: #7f8c8d;
}

/* Location Info Styling */
.location-info {
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #3498db;
    font-size: 1.1rem;
}

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


/* Location Badge Styling */
.location-badge {
    display: inline-block;
    background: #f8f9fa;
    color: #2c3e50;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 5px 0;
    border-left: 3px solid #3498db;
}

/* Location Info Styling */
.location-info {
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 15px 0;
    border-left: 4px solid #3498db;
    font-size: 1.1rem;
}

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

/* Share Button Styling */
.share-actions {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid #ecf0f1;
    text-align: center;
}

.share-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease, transform 0.2s ease;
    margin: 5px;
}

.share-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.email-share {
    background: #e74c3c;
}

.email-share:hover {
    background: #c0392b;
}

/* Search Results Page */
.search-results {
    margin-top: 2rem;
}

.search-results h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

/* Item Category Badge */
.item-category {
    display: inline-block;
    background: #f8f9fa;
    color: #7f8c8d;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 5px;
    border: 1px solid #e0e0e0;
}

/* Condition Badge */
.condition-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 2px;
    font-weight: bold;
}

.condition-badge.excellent { background: #d4edda; color: #155724; }
.condition-badge.good { background: #fff3cd; color: #856404; }
.condition-badge.fair { background: #ffeaa7; color: #856404; }
.condition-badge.tlc { background: #f8d7da; color: #721c24; }
.condition-badge.needs-tlc { background: #f8d7da; color: #721c24; }

/* Navbar button container */
.nav-container > div {
    display: flex;
    gap: 10px;
}

/* Mobile Responsive Updates */
@media (max-width: 768px) {
    .nav-container > div {
        flex-direction: column;
        gap: 5px;
    }
    
    .share-actions {
        text-align: center;
    }
    
    .share-btn {
        width: 100%;
        margin: 5px 0;
    }
}

/* Update item card to show location in list view */
.item-info .location-badge {
    display: inline-block;
    background: #f8f9fa;
    color: #2c3e50;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* Horizontal layout for category items */
.item-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 20px;
    min-height: 150px;
    width: 100%;
}

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

.item-image-container {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
}

.item-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.item-info h3 {
    color: #2c3e50;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
    word-wrap: break-word;
}

.price {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 0;
}

.more-info-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 120px;
    transition: background 0.3s ease;
    margin-top: 10px;
}

.more-info-btn:hover {
    background: #2980b9;
}

/* Item Detail Section */
.section-header, .detail-header {
    margin-bottom: 2rem;
}

.section-header h2, .detail-header h2 {
    margin-top: 1rem;
    text-align: center;
    color: #2c3e50;
}

.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: #7f8c8d;
}

.detail-content {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Detail Images - 1:1 Square ratio */
.detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 2rem;
}

.detail-image-container {
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* 1:1 aspect ratio */
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.detail-image-container:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.detail-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stack all elements vertically in detail page */
.detail-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-info h3 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin: 0;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.detail-price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 0;
}

.condition {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    margin: 0;
    width: fit-content;
    font-size: 1.1rem;
}

.condition.excellent { background: #d4edda; color: #155724; }
.condition.good { background: #fff3cd; color: #856404; }
.condition.fair { background: #ffeaa7; color: #856404; }
.condition.tlc { background: #f8d7da; color: #721c24; }

.description {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin: 0;
}

.description h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.3rem;
}

.description p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.1rem;
}

.contact-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 0;
    border-left: 4px solid #3498db;
}

.contact-info h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
    font-size: 1.3rem;
}

.contact-info p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.ref-number {
    padding: 1rem;
    background: #2c3e50;
    color: white;
    border-radius: 5px;
    text-align: center;
    font-family: 'Courier New', monospace;
    margin: 0;
    font-size: 1.1rem;
}

.hidden {
    display: none;
}

/* Image Zoom Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #e74c3c;
}

.modal-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
}

.prev-btn, .next-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.prev-btn:hover, .next-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.image-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 15px;
    border-radius: 20px;
}

/* Search Page Specific Styles */
.search-result {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin-top: 1rem;
    border-left: 4px solid #3498db;
    transition: transform 0.3s ease;
}

.search-result:hover {
    transform: translateY(-2px);
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #e74c3c;
}

.error-message h3 {
    margin-top: 0;
    color: #721c24;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 5px;
    text-align: center;
    border-left: 4px solid #27ae60;
}

/* Quick actions */
.quick-actions {
    display: flex;
    gap: 10px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Search history items */
.item-list-item {
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.item-list-item:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

/* Search input styling */
#searchRef {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
}

/* Recent searches section */
#recentSearches {
    border-top: 2px solid #ecf0f1;
    padding-top: 2rem;
}

#recentSearches h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 4.5rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .detail-images {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .modal-nav {
        padding: 0 10px;
    }
    
    .prev-btn, .next-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    /* Mobile layout for category items */
    .item-card {
        flex-direction: row;
        padding: 12px;
        gap: 15px;
        min-height: 130px;
    }
    
    .item-image-container {
        width: 100px;
        height: 100px;
    }
    
    .item-info h3 {
        font-size: 1.1rem;
    }
    
    .price {
        font-size: 1.2rem;
    }
    
    .more-info-btn {
        width: 110px;
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .detail-info h3 {
        font-size: 1.5rem;
    }
    
    .detail-price {
        font-size: 1.5rem;
    }
    
    .search-result {
        padding: 1.5rem;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-actions .btn {
        width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .item-card {
        gap: 12px;
        padding: 10px;
    }
    
    .item-image-container {
        width: 80px;
        height: 80px;
    }
    
    .item-info h3 {
        font-size: 1rem;
    }
    
    .price {
        font-size: 1.1rem;
    }
    
    .more-info-btn {
        width: 100px;
        padding: 7px 12px;
        font-size: 0.8rem;
    }
    
    .detail-images {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .detail-content {
        padding: 1rem;
    }
    
    .detail-info h3 {
        font-size: 1.3rem;
    }
    
    .detail-price {
        font-size: 1.3rem;
    }
    
    .admin-container {
        padding: 0 10px;
    }
    
    .admin-form {
        padding: 1.5rem;
    }
}

/* Admin Styles */
.admin-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 20px;
}

.admin-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

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

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

.btn-danger:hover {
    background: #c0392b;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-info {
    background: #9b59b6;
    color: white;
}

.btn-info:hover {
    background: #8e44ad;
}

.items-list {
    margin-top: 2rem;
}

.item-list-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.item-list-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.item-list-actions {
    display: flex;
    gap: 10px;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 33% { content: '.'; }
    34%, 66% { content: '..'; }
    67%, 100% { content: '...'; }
}

/* Error states */
.error {
    border-color: #e74c3c !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success states */
.success {
    border-color: #27ae60 !important;
}

.success-message {
    color: #27ae60;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Utility classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #7f8c8d;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

/* Ensure all images maintain aspect ratio */
.detail-images img {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Section headers for detail view */
.section-header, .detail-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-header h2, .detail-header h2 {
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Print styles */
@media print {
    .navbar, .admin-btn, .item-list-actions, .quick-actions,
    .back-btn, .more-info-btn, .form-actions {
        display: none !important;
    }
    
    .search-result {
        border: 1px solid #ddd;
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .detail-content {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animation for smooth transitions */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Focus styles for accessibility */
button:focus, input:focus, select:focus, textarea:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}