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

body {
    font-family: "Arial", sans-serif;
    color: #333;
    background-color: #f9f9f9;
    line-height: 1.6;
}

/* Container */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    text-align: center;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.controls label {
    margin-right: 10px;
}

#search-input {
    padding: 8px 12px;
    width: 200px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

#search-input:focus {
    border-color: #2c3e50;
    outline: none;
}

/* Navigation Buttons */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.plant-navigation {
    display: flex;
    gap: 10px;
}

/* Buttons */
button {
    padding: 8px 12px;
    border: none;
    background-color: #2c3e50;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    background-color: #34495e;
}

/* Loading Indicator */
#loading {
    margin-bottom: 20px;
    font-size: 1rem;
    color: #2c3e50;
}

.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2c3e50;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px auto;
}

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

/* Error Message */
#error-message {
    margin-bottom: 20px;
    color: #e74c3c; /* Red color for errors */
    font-weight: bold;
}

/* Plant Table View */
#plant-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

#plant-table th, #plant-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

#plant-table th {
    background-color: #2c3e50;
    color: #fff;
}

#plant-table td {
    background-color: #f4f4f4;
}

#plant-table img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

/* Plant Grid View */
#grid-view {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.plant-card {
    background-color: #f4f4f4;
    border-radius: 10px;
    padding: 15px;
    width: 200px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: left;
    transition: transform 0.3s ease;
}

.plant-card:hover {
    transform: translateY(-5px);
}

.plant-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.plant-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.plant-card p {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

/* Pagination Controls */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#pagination button {
    padding: 8px 12px;
    border: none;
    background-color: #2c3e50;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

#pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#pagination button:hover:not(:disabled) {
    background-color: #34495e;
}

#pagination span {
    font-size: 1rem;
    color: #2c3e50;
}

/* Plant Details Page */
#plant-details img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 20px;
}

#plant-details p {
    margin-bottom: 10px;
    font-size: 1rem;
    text-align: left;
}

/* Search Results in Plant Page */
#plant-details ul {
    list-style-type: none;
    padding-left: 0;
}

#plant-details li {
    margin-bottom: 5px;
}

#plant-details a {
    color: #2c3e50;
    text-decoration: none;
}

#plant-details a:hover {
    text-decoration: underline;
}

/* Highlight Current Plant */
.current-plant {
    background-color: #e0f7fa; /* Light cyan background */
    font-weight: bold;
    color: #00796b; /* Teal text color */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .navigation {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .plant-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .plant-navigation button {
        width: 100%;
    }

    #search-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #plant-table, #plant-table th, #plant-table td {
        display: block;
        width: 100%;
    }

    #plant-table {
        border: none;
    }

    #plant-table th {
        display: none;
    }

    #plant-table td {
        padding: 10px 5px;
        border: none;
        position: relative;
        text-align: right;
    }

    #plant-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        font-weight: bold;
        text-align: left;
    }

    #grid-view {
        flex-direction: column;
        align-items: center;
    }

    .plant-card {
        width: 100%;
        max-width: 300px;
    }
}

/* styles.css */

/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    width: 90%;
    margin: auto;
    padding: 20px;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.controls label,
.controls select,
.controls button,
.controls input {
    margin-right: 10px;
}

/* Loading Indicator */
#loading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.hidden {
    display: none;
}

/* Spinner */
.spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #2c3e50;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
    margin-bottom: 10px;
}

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

/* Error Message */
#error-message {
    color: red;
    text-align: center;
    margin-bottom: 20px;
}

/* Table Styles */
#plant-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#plant-table th, #plant-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#plant-table th {
    background-color: #2c3e50;
    color: white;
}

/* Image Gallery in Table and Grid Views */
.plant-images {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
}

.plant-images img.thumbnail {
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Grid View Styles */
#grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.plant-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    width: calc(25% - 20px); /* Adjust based on the number of columns */
    box-sizing: border-box;
    text-align: center;
    width: 30%;
}

.plant-card img.thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin-bottom: 10px;
}

/* Plant Details Page */
.navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.navigation button {
    padding: 10px 20px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.navigation button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.image-gallery {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.image-gallery img.detail-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 4px;
}


@media (max-width: 768px) {
    .plant-card {
        width: calc(50% - 20px);
    }
}

@media (max-width: 480px) {
    .plant-card {
        width: 100%;
    }
}

        #pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 20px;
            flex-wrap: wrap;
            gap: 5px;
        }

        #pagination button {
            padding: 8px 12px;
            margin: 2px;
            border: none;
            cursor: pointer;
            border-radius: 4px;
            transition: background-color 0.3s;
        }



        #pagination button.active {
            background-color: #007BFF;
            color: white;
            cursor: default;
        }


        #pagination .dots {
            padding: 8px 12px;
        }
