/* Global Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #fdfdfd;
    margin: 0;
    padding: 0;
    color: #333;
}

main {
    max-width: 80%;
    margin: 20px auto;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
}


/* Navbar */
.navbar {
    background-color: #004080;
    color: white;
    padding: 12px 24px;
    display: flex;
    justify-content: center;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-list li a {
    text-decoration: none;
    color: white;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.nav-list li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Forms */
form {
    display: flex;
    flex-direction: column;
}

/* Ensure room for dropdown arrow */
select:focus {
    outline: none;
    border-color: #007bff;
}


input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
select,
button {
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    background-color: white;
    color: #333;
}

button {
    padding: 10px 16px;
    font-size: 16px;
    background-color: #0073e6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #005bb5;
}

#form-message {
    font-weight: bold;
    margin-top: 1em;
    color: #d8000c;
}

table {
    overflow-x: auto;
    display: block;
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    font-size: 15px;
    table-layout: fixed;
    /* enables % column widths */
}

th,
td {
    padding: 8px 12px;
    border: 1px solid #ccc;
    text-align: left;
    word-wrap: break-word;
}

th {
    background-color: #f2f2f2;
}

/* Column width guidelines */
#members-table th:nth-child(1),
/* Name */
#horses-table th:nth-child(1) {
    width: 20%;
    min-width: 120px;
}

#members-table th:nth-child(2),
/* Email */
#horses-table th:nth-child(2) {
    width: 20%;
    min-width: 140px;
}

#members-table th:nth-child(3),
/* Phone or Color */
#horses-table th:nth-child(3) {
    width: 15%;
    min-width: 100px;
}

#members-table th:nth-child(4),
/* Type or DOB */
#horses-table th:nth-child(4) {
    width: 15%;
    min-width: 100px;
}

#members-table th:nth-child(5),
/* Submitted By */
#horses-table th:nth-child(6) {
    width: 30%;
    min-width: 160px;
}


/* Responsive tweaks */
@media (max-width: 640px) {
    main {
        margin: 20px 16px;
        padding: 16px;
    }

    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}


/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
}

.modal-button-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 1em;
}

.modal-btn {
    padding: 8px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    min-width: 80px;
    color: white;
}

.modal-btn.edit {
    background-color: #007bff;
}

.modal-btn.delete {
    background-color: #d9534f;
}


hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 5px 0;
}


.prefix-suffix-row {
    display: flex;
    gap: 10px;
    max-width: 800px;
    margin-bottom: 10px;
}

.prefix-suffix-row select {
    flex: 1;
}

.prefix-suffix-row input {
    flex: 2;
}


.photo-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.photo-upload-block {
    text-align: center;
}

.example-photo {
    width: 200px;
    height: 200px;
    object-fit: scale-down;
    /* Use 'contain' if you prefer full image shown with padding */
    display: block;
    margin: 0 auto 8px auto;
}

.preview-photo {
    width: 100px;
    height: 100px;
    object-fit: scale-down;
    /* Use 'contain' if you prefer full image shown with padding */
    display: block;
    margin: 0 auto 8px auto;
}

.required {
    color: red;
    font-weight: bold;
}


.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 1em;
}

.tab-btn {
    padding: 8px 16px;
    border: 1px solid #aaa;
    background-color: #727272;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    font-weight: bold;
}

.tab-btn.active {
    background-color: #0073e6;
    border-bottom: 1px solid #fff;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    /* key for centering */
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    /* optional dim background */
    z-index: 1000;
}

.modal-content {
    background-color: #fff;
    padding: 2em;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}