/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles */
body {
    font-family: Consolas, 'Courier New', monospace;
    color: #000000; /* Black text */
    background-color: #FFC107; /* Amber background */
    line-height: 1.6;
    font-size: 16px; /* Base font size */
}

/* Headings */
h1, h2, h3 {
    color: #008000; /* Green headings */
    margin-bottom: 1rem;
}

/* Header */
header {
    text-align: center;
    padding: 1rem;
    width: 100%;
}

/* Navigation */
nav {
    margin: 1rem 0;
}

/* Main content */
main {
    max-width: 90vw; /* Responsive width */
    margin: 0 auto;
    padding: 2rem;
}

/* Sections */
section {
    margin-bottom: 2rem;
}

/* Links */
a.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: #000000; /* Black text */
    background-color: #FFC107; /* Amber background */
    text-decoration: none;
    border: 2px solid #000000; /* Black border */
    border-radius: 4px;
    transition: all 0.3s ease;
}

a.btn:hover {
    color: #FFC107; /* Amber text on hover */
    background-color: #000000; /* Black background on hover */
    border-color: #FFC107; /* Amber border on hover */
}

/* Contact Owner link */
a.contact-owner {
    position: relative;
}

a.contact-owner:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #000000;
    color: #FFC107;
    padding: 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.9rem;
    z-index: 10;
}

/* Buttons (non-link) */
button.btn {
    padding: 0.5rem 1rem;
    color: #000000;
    background-color: #FFC107;
    border: 2px solid #000000;
    border-radius: 4px;
    font-family: Consolas, 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

button.btn:hover {
    color: #FFC107;
    background-color: #000000;
    border-color: #FFC107;
}

/* Form inputs */
input[type="text"], input[type="email"], input[type="password"], textarea {
    display: block;
    width: 100%;
    max-width: 300px;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border: 2px solid #000000;
    border-radius: 4px;
    font-family: Consolas, 'Courier New', monospace;
    background-color: #FFF8E1; /* Light amber for input background */
    color: #000000;
}

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

/* Search form */
.search-form {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
}

.search-form input[type="text"] {
    max-width: 400px;
    flex-grow: 1;
}

/* Visually hidden for accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Tables */
table.resource-table {
    width: 100%;
    max-width: 100vw; /* Full viewport width */
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: auto; /* Allow columns to adjust based on content */
}

th, td {
    padding: 0.75rem;
    border: 2px solid #000000;
    text-align: left;
    color: #000000;
    background-color: #FFF8E1; /* Light amber for table cells */
    word-wrap: break-word; /* Wrap long text */
}

th {
    background-color: #FFD700; /* Gold for table headers */
    color: #008000; /* Green text for headers */
}

/* Badges */
.badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: #000000;
    border: 2px solid #000000;
    display: inline-block;
}

.badge.gold {
    background-color: #FFD700; /* Gold for verified users */
}

.badge.bronze {
    background-color: #CD7F32; /* Bronze for others */
}

.badge:hover {
    color: #FFC107;
    background-color: #000000;
    border-color: #FFC107;
}

/* Accessibility */
:focus {
    outline: 3px solid #008000; /* Green outline for focus */
    outline-offset: 2px;
}

/* Footer */
footer {
    text-align: center;
    padding: 1rem;
    width: 100%;
}

/* Responsive design */

/* Small screens (mobile, <600px) */
@media (max-width: 600px) {
    body {
        font-size: 14px; /* Smaller font for mobile */
    }

    main {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    a.btn, button.btn, input[type="text"], input[type="email"], input[type="password"], textarea {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        max-width: 100%;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form input[type="text"] {
        max-width: 100%;
    }

    table.resource-table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem;
    }

    /* Stack table columns for very small screens */
    table.resource-table {
        display: block;
        overflow-x: auto; /* Horizontal scroll if needed */
    }

    thead {
        display: none; /* Hide headers on mobile */
    }

    tr {
        display: block;
        margin-bottom: 0.5rem;
        border-bottom: 2px solid #000000;
    }

    td {
        display: block;
        text-align: left;
        padding: 0.3rem 0.5rem;
    }

    td:before {
        content: attr(data-label);
        font-weight: bold;
        display: inline-block;
        width: 100px;
        color: #008000;
    }

    td[data-label="Contact"], td[data-label="Actions"] {
        text-align: center;
    }

    a.contact-owner:hover::after {
        left: 0;
        transform: none;
        width: fit-content;
    }
}

/* Medium screens (tablets, 600-1024px) */
@media (min-width: 600px) and (max-width: 1024px) {
    body {
        font-size: 15px;
    }

    main {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    table.resource-table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 0.6rem;
    }
}

/* Large screens (desktops, >1024px) */
@media (min-width: 1024px) {
    main {
        max-width: 1200px; /* Increased for larger tables */
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.4rem;
    }
}
