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

.rnz-form-container {
    background-image: url('https://via.placeholder.com/1500x800.png?text=Agri+Background'); /* Replace with actual farm image URL */
    background-size: cover;
    background-position: center;
    color: #2f2f2f;
    padding: 1.5rem;
    max-width: 100%;
}

.rnz-form-container form {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

/* Agricultural accents for frontend only */
.rnz-form-container h1,
.rnz-form-container h2 {
    color: #2f2f2f;
    padding: 0.5rem;
    border-radius: 0.25rem;
    text-align: center;
    background-color: #e8f5e9; /* Light green instead of blue */
}

.rnz-form-container input,
.rnz-form-container textarea,
.rnz-form-container select {
    border: 1px solid #a3bffa;
    border-radius: 0.25rem;
    padding: 0.5rem;
    width: 100%;
    font-size: 1rem;
}

.rnz-form-container input:focus,
.rnz-form-container textarea:focus,
.rnz-form-container select:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.rnz-form-container button {
    background-color: #2e7d32;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.25rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 1rem;
}

.rnz-form-container button:hover,
.rnz-form-container button:focus {
    background-color: #1b5e20;
}

.rnz-form-container button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.3);
}

/* Modal styles */
.rnz-form-container .modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.rnz-form-container .modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.rnz-form-container .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #2f2f2f;
}

.rnz-form-container .close:hover,
.rnz-form-container .close:focus {
    color: #1b5e20;
}

/* Loading spinner */
.rnz-form-container .loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2e7d32;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Admin dashboard styles (scoped to avoid frontend conflicts) */
.rnz-dashboard {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.rnz-dashboard h1 {
    font-size: 28px;
    font-weight: bold;
    color: #2e7d32;
    text-align: center;
    margin-bottom: 20px;
}

.rnz-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.rnz-stat-card {
    background-color: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.rnz-stat-label {
    font-size: 16px;
    color: #2e7d32;
    margin-bottom: 5px;
}

.rnz-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #1b5e20;
}

.rnz-table-container {
    overflow-x: auto;
}

.rnz-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.rnz-table th,
.rnz-table td {
    padding: 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.rnz-table th {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: bold;
}

.rnz-table tr:nth-child(even) {
    background-color: #f9fbe7;
}

.rnz-table tr:hover {
    background-color: #e6ffe6;
}

.rnz-link {
    color: #2e7d32;
    text-decoration: underline;
}

.rnz-link:hover,
.rnz-link:focus {
    color: #1b5e20;
}

/* Filters */
.rnz-filters {
    display: flex;
    align-items: center; /* Align items vertically */
    gap: 10px; /* Space between elements */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    margin-bottom: 20px;
}

.rnz-filters form {
    display: flex;
    align-items: center; /* Align form elements vertically */
    gap: 10px; /* Space between form elements */
    flex-wrap: wrap; /* Allow wrapping */
}

.rnz-filters label {
    font-weight: bold;
    margin-right: 5px;
    align-self: center; /* Ensure labels align with inputs */
}

.rnz-filters select,
.rnz-filters input {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #a3bffa;
    font-size: 0.9rem;
}

.rnz-filters button {
    padding: 5px 10px;
    font-size: 0.9rem;
    background-color: #2e7d32; /* Match admin theme */
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.rnz-filters button:hover {
    background-color: #1b5e20;
}

/* Tabs */
.tab-buttons {
    display: flex;
    gap: 1rem; /* Consistent spacing */
    margin: 0; /* Remove margin to align with filters */
}

.tab-button {
    padding: 0.5rem 1rem;
    background-color: #e8f5e9;
    color: #2e7d32;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    font-size: 1rem;
    outline: none;
}

.tab-button.active {
    background-color: #2e7d32;
    color: white;
    font-weight: bold;
}

.tab-button:hover {
    background-color: #1b5e20;
    color: white;
}

/* Ensure focus state */
.tab-button:focus {
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.5);
}

/* Pagination */
.rnz-pagination a,
.rnz-pagination span {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 5px;
    border: 1px solid #a3bffa;
    border-radius: 4px;
    color: #2e7d32;
    text-decoration: none;
}

.rnz-pagination a:hover,
.rnz-pagination a:focus {
    background-color: #e8f5e9;
    color: #1b5e20;
}

.rnz-pagination .current {
    background-color: #2e7d32;
    color: white;
    border-color: #2e7d32;
}

/* Responsive design */
@media (max-width: 768px) {
    .rnz-form-container {
        padding: 1rem;
    }

    .rnz-form-container form {
        padding: 1rem;
        max-width: 100%;
    }

    .rnz-form-container h1,
    .rnz-form-container h2 {
        font-size: 1.5rem;
        padding: 0.4rem;
    }

    .rnz-form-container input,
    .rnz-form-container textarea,
    .rnz-form-container select {
        font-size: 0.9rem;
        padding: 0.4rem;
    }

    .rnz-form-container button {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .rnz-form-container .modal-content {
        margin: 10% 5%;
        max-width: 90%;
        padding: 15px;
    }

    .rnz-stats-grid {
        grid-template-columns: 1fr;
    }

    .rnz-table th,
    .rnz-table td {
        padding: 8px;
        font-size: 0.85rem;
    }

    .rnz-filters {
        flex-direction: column;
        gap: 5px;
    }

    .rnz-filters select,
    .rnz-filters input,
    .rnz-filters button {
        width: 100%;
        margin-bottom: 10px;
    }

    .tab-buttons {
        flex-direction: column;
        gap: 5px;
    }

    .tab-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .rnz-dashboard h1 {
        font-size: 1.8rem;
    }

    .rnz-stat-card {
        padding: 10px;
    }

    .rnz-stat-label {
        font-size: 14px;
    }

    .rnz-stat-value {
        font-size: 20px;
    }

    .rnz-table-container {
        font-size: 0.8rem;
    }

    .rnz-table th,
    .rnz-table td {
        padding: 6px;
    }
}

.rnz-form-container .agree-terms-container {
    margin-top: 0.5rem !important; /* Matches mt-2 */
    margin-left: 1.5rem !important; /* Matches ml-6 */
    text-align: left !important; /* Override any centering */
    display: block !important; /* Ensure it behaves as a block */
}

.rnz-form-container .agree-terms-container .flex {
    align-items: center !important; /* Center vertically within flex */
    justify-content: flex-start !important; /* Align content to the left */
    width: auto !important; /* Allow natural width */
}

.rnz-form-container .agree-terms-container label {
    margin-left: 0.5rem !important; /* Ensure spacing */
    vertical-align: middle !important; /* Align text with checkbox */
}

.rnz-form-container input#agree_terms {
    width: auto !important; /* Reset to natural size and override any large width */
}