/* Aruba Marketplace - Main Stylesheet */
/* Version: v1.1.5 */

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background: #418FDE;
    color: #333;
}

header {
    background: #418FDE;
    color: #EF3340;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}

header h1 {
    margin: 0;
    font-size: 2rem;
    text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff,
        1px 1px #fff, -1px -1px #fff, 1px -1px #fff, -1px 1px #fff;
}

nav {
    margin-top: 0.5rem;
}

nav a {
    color: #ecf0f1;
    text-decoration: none;
    margin-right: 1.5rem;
    font-weight: bold;
}

nav a:hover {
    text-decoration: underline;
    color: #F7D417;
}

#content-wrapper {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 1rem;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

footer {
    text-align: center;
    padding: 1.5rem;
    background: #418FDE;
    color: #F7D417;
    margin-top: 2rem;
    font-size: 0.9rem;
}

/* Alerts */
.error-box {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

.success-box {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}

.warning-box {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ffeeba;
    border-radius: 4px;
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

label {
    font-weight: bold;
    display: block;
    margin-bottom: 0.25rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

button {
    padding: 0.75rem;
    background: #3498db;
    color: #F7D417;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
}

button:hover {
    background: #2980b9;
}

fieldset {
    border: 1px solid #ddd;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

legend {
    font-weight: bold;
    padding: 0 0.5rem;
}

/* Grid & Listings */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
    padding: 0.5rem;
    background: #fff;
}

.listing-item {
    border: 1px solid #ddd;
    padding: 0.75rem;
    background: #fafafa;
    border-radius: 4px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.listing-item:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.thumb {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    background: #eee;
    display: block;
}

.price {
    font-weight: bold;
    color: #27ae60;
    margin-top: 0.5rem;
}

.seller {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.title {
    margin-top: 0.5rem;
    font-size: 1rem;
    flex-grow: 1;
}

.title a {
    text-decoration: none;
    color: #2c3e50;
}

.title a:hover {
    text-decoration: underline;
}

/* Filter Form */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    max-width: 100%;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
}

.filter-form select,
.filter-form input[type=text] {
    padding: 0.4rem;
    min-width: 120px;
    flex: 1;
    max-width: 200px;
    font-size: 0.9rem;
}

.filter-form button {
    padding: 0.4rem 1rem;
    white-space: nowrap;
    font-size: 0.9rem;
}

/* Category Dropdown Indentation */
select[name="category_id"] option {
    padding-left: 0.5rem;
}

select[name="category_id"] option[data-depth="1"] {
    padding-left: 1.5rem;
    font-style: italic;
}

select[name="category_id"] option[data-depth="2"] {
    padding-left: 2.5rem;
    font-style: italic;
}

select[name="category_id"] option[data-depth="3"] {
    padding-left: 3.5rem;
    font-style: italic;
}

select[name="category_id"] option[data-depth="1"]:before {
    content: "↳ ";
    color: #666;
    margin-right: 2px;
}

/* Listing Detail Page */
.listing-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.listing-photo {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
    object-fit: contain;
    background: #f0f0f0;
}

.seller-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 0.5rem;
    align-items: flex-start;
}

.seller-name-block {
    flex: 1;
    min-width: 200px;
}

.contact-block {
    flex: 1;
    min-width: 200px;
}

.seller-business {
    color: #27ae60;
    font-weight: bold;
}

.listing-age {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

/* Grayscale for Expired/Hidden */
.listing-grayscale {
    opacity: 0.6;
    filter: grayscale(80%);
    border: 1px dashed #999;
}

.listing-grayscale .title a {
    color: #666;
}

.listing-grayscale .thumb {
    filter: grayscale(100%) !important;
    opacity: 1;
}

.listing-grayscale .price,
.listing-grayscale .seller {
    color: #888;
}

/* MODERATOR ACTION BOX (New) */
.moderator-action-box {
    margin-top: 2rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
}

.moderator-action-box h4 {
    margin-top: 0;
    color: #856404;
}

.moderator-action-box textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.moderator-action-box button {
    background: #dc3545;
    color: white;
    width: 100%;
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.moderator-action-box button:hover {
    background: #c82333;
}

/* Responsive */
@media (max-width: 600px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .filter-form select,
    .filter-form input[type=text] {
        min-width: auto;
        max-width: 100%;
    }

    .listing-grid {
        grid-template-columns: 1fr;
    }

    .seller-info-row {
        flex-direction: column;
        gap: 1rem;
    }

    .listing-photo {
        max-height: 250px;
    }

    #content-wrapper {
        margin: 1rem;
        padding: 0.75rem;
    }
}