/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}


/* Layout Components */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}


/* Header and Navigation */
.site-header {
    background-color: #4a90e2;
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    margin-bottom: 1.5rem;
}

.site-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nav-btn {
    background-color: #357abd;
    color: white;
    border: 1px solid #2968a3;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: normal;
    transition: background-color 0.2s ease;
}

.nav-btn:hover {
    background-color: #2968a3;
}


/* Main Content */
.main-content {
    padding: 0 1.5rem 1.5rem;
}

.section-title {
    font-size: 1.75rem;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: bold;
}

.section-heading {
    font-size: 1.25rem;
    color: #333;
    margin-bottom: 1rem;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5rem;
}

.section-subheading {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.75rem;
    font-weight: bold;
}


/* Welcome Section (Index) */
.welcome-section {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background-color: #e3f2fd;
    border-radius: 5px;
    border: 1px solid #bbdefb;
}

.welcome-text {
    font-size: 1rem;
    font-weight: normal;
    color: #1976d2;
}


/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
    margin-bottom: 1.5rem;
}

.table-header {
    background-color: #4a90e2;
    color: white;
    padding: 0.75rem;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
}

.table-row {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background-color: #f9f9f9;
}

/* Clickable table rows (listings page) */
.listings-table .table-row {
    cursor: pointer;
}

/* Non-clickable table rows (index page) */
.recent-posts-table .table-row {
    cursor: default;
}

.table-cell {
    padding: 0.75rem;
    vertical-align: top;
}

.date-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #666;
}

.pet-info {
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pet-quantity, .pet-type, .pet-age {
    margin-bottom: 0.25rem;
}

.pet-type {
    font-weight: bold;
    color: #4a90e2;
}

.contact-info {
    font-size: 0.9rem;
}

.contact-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #333;
}

.contact-method {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.contact-type {
    font-weight: bold;
    color: #666;
}

.contact-value {
    color: #4a90e2;
}

.photo-cell {
    text-align: center;
}

.pet-photo {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: transform 0.2s ease;
}

.pet-photo:hover {
    transform: scale(1.1);
}

.photo-count {
    text-align: center;
    font-weight: bold;
    color: #4a90e2;
}

/* Forms */
.adoption-form {
    border-radius: 5px;
    padding: 1.5rem;
    border: 1px solid #ddd;
}

.form-section {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    background-color: #fafafa;
}

.form-section legend {
    padding: 0.25rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-weight: bold;
    color: #333;
}

.form-row {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.age-row {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: end;
}

.form-label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: bold;
    color: #333;
}

.form-input {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #4a90e2;
}

.form-input:disabled {
    background-color: #f0f0f0;
    color: #999;
}

/* Contact Methods */
.contact-methods-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-method-row {
    display: flex;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.contact-method-controls {
    display: flex;
    gap: 0.5rem;
    align-self: center;
}

/* Photo Upload */
.photos-section {
    margin-top: 1rem;
}

.photos-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.photo-row {
    display: flex;
    gap: 0.75rem;
    align-items: end;
    padding: 0.75rem;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.photo-row .btn {
    align-self: center;
}

.photo-input {
    flex: 1;
}

/* Form Errors */
.form-error-indicator {
    border: 1px solid #f44336;
    background: #ffebee;

}


/* Form Messages */
.form-messages {
    margin: 1.5rem 0;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: 3px;
    border-left: 3px solid #f44336;
    margin-bottom: 1rem;
}

.success-message {
    background-color: #e8f5e8;
    color: #2e7d32;
    padding: 0.75rem;
    border-radius: 3px;
    border-left: 3px solid #4caf50;
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}


/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-weight: normal;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #4a90e2;
    color: white;
    border-color: #357abd;
}

.btn-primary:hover {
    background-color: #357abd;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border-color: #ccc;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
}

.btn-add {
    background-color: #357abd;
    color: white;
    border-color: #28639e;
}

.btn-add:hover {
    background-color: rgb(60, 148, 236);
}

.btn-remove {
    background-color: #5f5f5f;
    color: white;
    border-color: #414141;
}

.btn-remove:hover {
    background-color: #919191;
}


/* Post Detail Page */
.post-container {
    border-radius: 5px;
    padding: 1.5rem;
    border: 1px solid #ddd;
}

.post-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fafafa;
    border-radius: 3px;
    border-left: 3px solid #4a90e2;
}

.post-photos-section {
    margin-bottom: 1.5rem;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.post-photo {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 3px;
    border: 1px solid #ddd;
    transition: transform 0.2s ease;
}

.photo-thumbnail {
    cursor: pointer;
}

.photo-thumbnail:hover {
    transform: scale(1.02);
}

.detail-row {
    display: flex;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #eee;
}

.detail-label {
    font-weight: bold;
    color: #333;
    min-width: 100px;
    margin-right: 0.75rem;
}

.detail-value {
    color: #666;
    flex: 1;
}

.description-content {
    padding: 1rem;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.description-text {
    line-height: 1.6;
    color: #555;
    font-size: 1rem;
}

.contact-methods-title {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin: 0.75rem 0 0.5rem 0;
}

.contact-method-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    padding: 0.25rem;
    border-radius: 3px;
}

.contact-method-type {
    font-weight: bold;
    color: #666;
}

.contact-method-value {
    color: #4a90e2;
}

.post-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}


/* Statistics Page */
.statistics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-item {
    background-color: white;
    border-radius: 5px;
    padding: 1rem;
    border: 1px solid #ddd;
    text-align: center;
    transition: transform 0.2s ease;
    max-width: 60%;
    margin: 0 auto;
}

.stat-item:hover {
    transform: scale(1.25);
}

.stat-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 0.75rem;
}

.stat-image {
    width: 100%;
    height: auto;
    border-radius: 3px;
    border: 1px solid #ddd;
}


/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.modal-content {
    background-color: rgb(0, 0, 0, 0.6);
    border-radius: 5px;
    padding: 1.5rem;
    max-width: 450px;
    width: 90%;
    position: relative;
    border: 1px solid black;
}

.modal-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}

.modal-close-text {
    color: #cccccc;
    cursor: pointer;
    font-weight: bold;
    padding: 0.25rem;
    border-radius: 3px;
    transition: color 0.2s ease;
}

.modal-close-text:hover {
    /* background-color: #f0f0f0; */
    color: white;
}

.modal-text {
    font-size: 1rem;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: center;
}


/* Image Modal Specific */
.image-modal-content {
    max-width: 85%;
    max-height: 85%;
    padding: 0.75rem;
}

.image-modal-body {
    text-align: center;
}

.modal-image {
    width: 800px;
    /* max-width: 100%; */
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 3px;
    border: 1px solid #333;
}


/* Utility Classes */
[hidden] {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}
