/* FIX IT Malta & Gozo
   Main Stylesheet v0.1.0
*/

:root {
    --primary: #285c46;
    --primary-dark: #194331;
    --primary-light: #e4efe8;
    --accent: #d49a42;
    --background: #f5f3ed;
    --surface: #ffffff;
    --text: #26352e;
    --muted: #68756d;
    --border: #dedfd9;
    --success: #27834f;
    --danger: #b83232;
    --radius: 14px;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* Header */

header {
    background: var(--primary);
    color: white;
    padding: 24px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 32px;
}

header p {
    margin: 8px 0 0;
}

header a {
    color: white;
}

/* Navigation */

.navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 12px 20px;
    background: var(--primary-dark);
}

.navigation a {
    color: white;
    font-weight: 600;
}

/* Main content */

main {
    max-width: 1200px;
    margin: auto;
    padding: 50px 20px;
}

.hero {
    text-align: center;
    padding: 30px 0;
}

.hero h2 {
    font-size: clamp(32px, 6vw, 54px);
    line-height: 1.2;
    margin: 0 0 20px;
}

.intro {
    font-size: 19px;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto 40px;
    text-align: center;
}

/* Cards */

.cards {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 30px 24px;
    box-shadow: var(--shadow);
}

.card h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 26px;
}

.card p {
    line-height: 1.6;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary-light);
    text-decoration: none;
}

/* Forms */

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus,
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

textarea {
    min-height: 140px;
    resize: vertical;
}

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

/* Search and filters */

.search-panel {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.filter-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

/* Categories */

.category-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.category-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
    color: var(--primary);
}

.category-card:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* Listings */

.listing-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.listing-type {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
}

.type-offer {
    background: #e4efe8;
    color: #285c46;
}

.type-need {
    background: #e3edf7;
    color: #245580;
}

.location {
    color: var(--muted);
    font-size: 14px;
}

/* Notices */

.notice {
    margin-top: 45px;
    color: var(--muted);
    text-align: center;
}

.text-center {
    text-align: center;
}

/* Footer */

footer {
    padding: 25px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
    font-size: 14px;
    color: var(--muted);
}

/* Mobile devices */

@media (max-width: 600px) {
    header {
        padding: 18px;
    }

    main {
        padding: 25px 15px;
    }

    .navigation {
        gap: 12px;
        font-size: 14px;
    }

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

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card,
    .listing-card,
    .search-panel {
        padding: 20px;
    }

    .intro {
        font-size: 17px;
    }
}
/* Browse Repairs */

.filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
    background: #ffffff;
    padding: 28px;
    border-radius: 16px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}

.filter-form label {
    grid-column: 1 / -1;
    font-weight: 600;
    margin-bottom: -6px;
}

.filter-form input,
.filter-form select {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.filter-form button {
    background: #105e48;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.filter-form button:hover {
    background: #084735;
}

.filter-form a {
    align-self: center;
    text-align: center;
}

.listing-results {
    margin: 40px 0;
}

.empty-state {
    background: #ffffff;
    padding: 35px 20px;
    border-radius: 16px;
    text-align: center;
}

.listing-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 18px;
    border: 1px solid #dce2dc;
}

@media (min-width: 768px) {
    .filter-form {
        grid-template-columns: 160px minmax(0, 1fr);
        align-items: center;
    }

    .filter-form label,
    .filter-form input,
    .filter-form select {
        grid-column: auto;
        margin: 0;
    }
}

@media (max-width: 767px) {
    .filter-form {
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .filter-form button {
        width: 100%;
    }
}