:root {
    --tp-green: #1a4d2e;
    --tp-gold: #c6a664;
    --tp-ink: #222;
    --tp-muted: #6b7280;
    --tp-light: #f3f4f6;
    --tp-white: #ffffff;
    --tp-border: #d1d5db;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #eab308;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--tp-ink);
    background: var(--tp-light);
    line-height: 1.6;
}

.admin-container,
.public-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    background: var(--tp-green);
    color: var(--tp-white);
    padding: 20px;
    margin: -20px -20px 20px;
    border-radius: 8px 8px 0 0;
}

.public-header {
    background: var(--tp-white);
    color: var(--tp-ink);
    padding: 30px 20px;
    margin: -20px -20px 20px;
    border-radius: 8px 8px 0 0;
    text-align: center;
    border-bottom: 3px solid var(--tp-green);
}

.back-to-main {
    text-align: left;
    margin-bottom: 15px;
}

.back-to-main a {
    color: var(--tp-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-to-main a:hover {
    color: var(--tp-gold);
}

.header-banner {
    margin-bottom: 15px;
}

.banner-logo {
    max-width: 800px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.admin-header h1,
.public-header h1 {
    margin-bottom: 10px;
    font-size: 1.75rem;
}

.tagline {
    color: var(--tp-green);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

@media (max-width: 768px) {
    .banner-logo {
        max-width: 450px;
    }
}

.admin-nav {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.admin-nav a {
    color: var(--tp-white);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: background 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

.login-box {
    max-width: 400px;
    margin: 100px auto;
    background: var(--tp-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.login-box h1 {
    color: var(--tp-green);
    margin-bottom: 30px;
    text-align: center;
}

.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.alert-success {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--tp-ink);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--tp-border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--tp-green);
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.1);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 15px;
    margin-bottom: 8px;
}

.help-text {
    display: block;
    margin-top: 4px;
    color: var(--tp-muted);
    font-size: 0.875rem;
}

.current-image {
    margin-bottom: 10px;
}

.current-image img {
    max-width: 200px;
    max-height: 150px;
    border: 1px solid var(--tp-border);
    border-radius: 4px;
    display: block;
    margin-bottom: 5px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background: #143d24;
}

.btn-secondary {
    background: var(--tp-gold);
    color: var(--tp-white);
}

.btn-secondary:hover {
    background: #b08f4f;
}

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

.btn-danger:hover {
    background: #b91c1c;
}

.btn-info {
    background: #0891b2;
    color: var(--tp-white);
}

.btn-info:hover {
    background: #0e7490;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.admin-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
}

.search-form {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--tp-border);
    border-radius: 4px;
    font-size: 1rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.listings-stats {
    margin-bottom: 15px;
    color: var(--tp-muted);
}

.listings-table {
    width: 100%;
    background: var(--tp-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.listings-table thead {
    background: var(--tp-green);
    color: var(--tp-white);
}

.listings-table th,
.listings-table td {
    padding: 12px 16px;
    text-align: left;
}

.listings-table tbody tr {
    border-bottom: 1px solid var(--tp-border);
}

.listings-table tbody tr:hover {
    background: var(--tp-light);
}

.listings-table tbody tr.hidden-listing {
    background: #fef9e7;
    opacity: 0.8;
}

.listings-table tbody tr.hidden-listing:hover {
    background: #fef3c7;
    opacity: 1;
}

.listings-table .actions {
    white-space: nowrap;
}

.listings-table .actions form {
    display: inline;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--tp-gold);
    color: var(--tp-white);
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.badge-warning {
    background: var(--warning);
    color: var(--tp-ink);
}

.area-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--tp-light);
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    font-size: 0.875rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.page-info {
    color: var(--tp-muted);
    font-weight: 500;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--tp-muted);
    background: var(--tp-white);
    border-radius: 8px;
}

.user-form {
    background: var(--tp-white);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-form h2 {
    margin-bottom: 20px;
    color: var(--tp-green);
}

.inline-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.inline-form input {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid var(--tp-border);
    border-radius: 4px;
}

.search-section {
    background: var(--tp-white);
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-large {
    flex: 1;
    padding: 14px 40px 14px 16px;
    border: 2px solid var(--tp-border);
    border-radius: 4px;
    font-size: 1.1rem;
}

.search-input-large:focus {
    outline: none;
    border-color: var(--tp-green);
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--tp-muted);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 4px;
}

.clear-search-btn:hover {
    color: var(--tp-green);
    background: var(--tp-light);
}

.filters-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--tp-border);
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--tp-ink);
}

.filter-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--tp-border);
    border-radius: 4px;
    font-size: 1rem;
    background: var(--tp-white);
    font-family: inherit;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--tp-green);
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.1);
}

.area-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.did-you-mean {
    background: #fef3c7;
    border-left: 4px solid var(--warning);
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.results-info {
    margin-bottom: 20px;
    color: var(--tp-muted);
}

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.listing-card {
    background: var(--tp-white);
    border-radius: 8px;
    padding: 30px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.listing-logo {
    margin-bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.listing-logo img {
    width: 100%;
    max-width: 180px;
    max-height: 180px;
    object-fit: contain;
}

.listing-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
}

.listing-info h3 {
    color: var(--tp-green);
    font-size: 1.35rem;
    margin: 0;
    font-weight: 600;
    line-height: 1.2;
}

.listing-info .btn {
    margin-top: auto;
}

.listing-subcategories {
    color: var(--tp-muted);
    font-size: 0.95rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.subcategory-line {
    line-height: 1.4;
}

.back-link {
    margin-bottom: 20px;
}

.back-link a {
    color: var(--tp-green);
    text-decoration: none;
    font-weight: 500;
}

.back-link a:hover {
    text-decoration: underline;
}

.listing-profile {
    background: var(--tp-white);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.listing-header {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
}

.profile-logo {
    flex-shrink: 0;
}

.profile-logo img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
}

.profile-header-text h1 {
    color: var(--tp-green);
    font-size: 2rem;
    margin-bottom: 10px;
}

.profile-category {
    color: var(--tp-muted);
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.profile-categories {
    margin-bottom: 10px;
}

.profile-categories .profile-category {
    margin-bottom: 4px;
}

.profile-areas {
    margin-top: 10px;
}

.profile-photo {
    margin-bottom: 30px;
}

.profile-photo img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.profile-section {
    margin-bottom: 30px;
}

.profile-section h2 {
    color: var(--tp-green);
    font-size: 1.5rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tp-gold);
}

.profile-description {
    font-size: 1.1rem;
    line-height: 1.8;
}

.general-contact {
    margin-bottom: 30px;
    padding: 15px;
    background: var(--tp-light);
    border-radius: 8px;
    display: grid;
    gap: 10px;
}

@media (min-width: 769px) {
    .general-contact {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

.location-section {
    margin-bottom: 35px;
    padding-top: 20px;
    border-top: 1px solid var(--tp-border);
}

.location-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.location-heading {
    color: var(--tp-green);
    font-size: 1.25rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.contact-section-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 769px) {
    .contact-section-wrapper {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

.contact-details {
    display: grid;
    gap: 15px;
}

.contact-item {
    padding: 12px;
    background: var(--tp-light);
    border-radius: 4px;
}

.contact-item strong {
    color: var(--tp-green);
    margin-right: 10px;
    display: block;
    margin-bottom: 4px;
}

.contact-item a {
    color: var(--tp-ink);
    text-decoration: none;
}

.contact-item a:hover {
    color: var(--tp-green);
    text-decoration: underline;
}

.contact-map {
    position: sticky;
    top: 20px;
}

.service-areas {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.service-areas li {
    padding: 10px;
    background: var(--tp-light);
    border-left: 3px solid var(--tp-gold);
    border-radius: 4px;
}

.address-block {
    line-height: 1.6;
    color: var(--tp-ink);
    margin-top: 6px;
}

.address-block div {
    margin-bottom: 2px;
}

.map-container {
    width: 100%;
}

.map-embed {
    width: 100%;
    height: 320px;
    border-radius: 8px;
    border: 1px solid var(--tp-border);
}

@media (max-width: 768px) {
    .map-embed {
        height: 280px;
    }
}

.map-link {
    margin-top: 12px;
    text-align: center;
}

.map-link a {
    color: var(--tp-green);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--tp-green);
    border-radius: 4px;
    transition: all 0.2s;
}

.map-link a:hover {
    background: var(--tp-green);
    color: var(--tp-white);
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form {
        max-width: 100%;
    }
    
    .action-buttons {
        width: 100%;
    }
    
    .filters-bar {
        grid-template-columns: 1fr;
        position: sticky;
        top: 0;
        background: var(--tp-white);
        z-index: 10;
        padding: 15px;
        margin: -15px;
        border-radius: 8px;
    }
    
    .listings-grid {
        grid-template-columns: 1fr;
    }
    
    .listing-header {
        flex-direction: column;
    }
    
    .profile-logo img {
        width: 120px;
        height: 120px;
    }
    
    .listings-table {
        font-size: 0.875rem;
    }
    
    .listings-table th,
    .listings-table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .search-box {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.spinner {
    border: 4px solid var(--tp-border);
    border-top: 4px solid var(--tp-green);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--tp-muted);
    font-size: 1rem;
}
