/* Global styles and variables - S M Samiul Hasan */
:root {
    --primary: #1e8449;
    --secondary: #ffc107;
    --lightGreen: #e6f9ed;
    --darkGreen: #166534;
    --navy: #1a237e;
    --lightBlue: #e6f0ff;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --black: #000000;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 2px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.6;
    scroll-behavior: smooth;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

/* Responsive layout for larger screens - S M Samiul Hasan */
@media (min-width: 1024px) {
    .main-content {
        flex-direction: row;
        padding: 24px;
        align-items: flex-start;
    }
}

/* Sidebar styles - S M Samiul Hasan */
.sidebar {
    background-color: var(--white);
    padding: 16px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .sidebar {
        width: 240px;
        max-height: none;
        position: sticky;
        top: 16px;
    }
}

.sidebar-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    overflow-x: auto;
}

@media (min-width: 1024px) {
    .sidebar-categories {
        flex-direction: column;
        gap: 8px;
    }
}

.category-item {
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-item:hover {
    transform: translateX(5px);
}

.category-active {
    background-color: var(--primary);
    color: var(--white);
}

.category-inactive {
    background-color: transparent;
    color: var(--gray-700);
}

.category-inactive:hover {
    background-color: #1E8449;
    color: white;
}
/* Main content area styles - S M Samiul Hasan */
.trees-main {
    flex: 1;
    position: relative;
}

.trees-title {
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trees-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .trees-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .trees-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tree-card {
    background-color: var(--white);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tree-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.tree-image {
    background-color: var(--gray-200);
    height: 250px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    overflow: hidden;
}

.tree-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tree-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    cursor: pointer;
}

.tree-name:hover {
    color: var(--primary);
}

.tree-description {
    color: var(--gray-600);
    font-size: 14px;
    flex: 1;
    margin-bottom: 16px;
}

.tree-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.tree-category {
    background-color: var(--lightGreen);
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.tree-price {
    color: var(--primary);
    font-weight: 700;
    font-size: 18px;
}

.tree-button {
    background-color: var(--primary);
    color: var(--white);
    font-weight: 700;
    padding: 12px 16px;
    border-radius:30px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.tree-button:hover {
    background-color: var(--darkGreen);
}

/* Cart sidebar styles - S M Samiul Hasan */
.cart-sidebar {
    background-color: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    margin-top: 24px;
}

@media (min-width: 1024px) {
    .cart-sidebar {
        width: 288px;
        margin-top: 0;
        position: sticky;
        top: 16px;
        height: fit-content;
    }
}

.cart-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 320px;
    overflow-y: auto;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    transition: background-color 0.2s ease;
}

.cart-item:hover {
    background-color: #f8f8f8;
}

.cart-item-details {
    flex: 1;
}

.cart-item-name {
    font-weight: 600;
}

.cart-item-price {
    font-size: 14px;
    color: var(--primary);
    font-weight: 700;
}

.cart-item-delete {
    color: var(--gray-400);
    padding: 8px;
    cursor: pointer;
    transition: color 0.3s;
}

.cart-item-delete:hover {
    color: #ef4444;
}

.cart-total {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 20px;
}

.cart-checkout {
    width: 100%;
    background-color: var(--primary);
    color: var(--white);
    font-weight: 700;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.cart-checkout:hover {
    background-color: var(--darkGreen);
}

/* About section styles - S M Samiul Hasan */
.about-section {
    background-color: #F0FDF4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-container {  
    max-width: 1120px;
    width: 100%;
    padding: 24px;
}

.about-title {
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    color: var(--gray-800);
    margin-bottom: 32px;
    padding-bottom: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: auto;
}

@media (min-width: 768px) {
    .about-content {
        flex-direction: row;
        align-items: flex-start;
        gap: 32px;
    }
}

.about-image {
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .about-image {
        width: 50%;
    }
}

.about-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
}

@media (min-width: 768px) {
    .about-img-placeholder {
        height: 320px;
    }
}

.about-text {
    flex: 1;
    color: var(--gray-700);
    margin-top: 0;
}

.about-description {
    font-size: 18px;
    line-height: 1.75;
    margin-bottom: 24px;
}

.about-features {
    list-style-type: disc;
    list-style-position: inside;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 18px;
}

.about-feature {
    display: flex;
    align-items: center;
}


/* Impact section styles - S M Samiul Hasan */
.impact-section {
    background-color: var(--lightGreen);
    padding: 64px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.impact-container {
    max-width: 1024px;
    width: 100%;
    margin: 0 auto;
}

.impact-title {
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    color: var(--gray-800);
    margin-bottom: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.impact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .impact-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px;
    }
}

.impact-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;    
}

@media (min-width: 768px) {
    .impact-card {
        padding: 32px;
    }
}

.impact-number {
    font-size: 36px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    .impact-number {
        font-size: 48px;
    }
}

.impact-label {
    font-size: 14px;
    color: var(--gray-600);
}

@media (min-width: 768px) {
    .impact-label {
        font-size: 18px;
    }
}

/* Plant section styles - S M Samiul Hasan */
.plant-section {
    background-color: var(--darkGreen);
    padding: 64px 16px;
}

.plant-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.plant-form-container {
    background-color: var(--primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 448px;
    padding: 24px;
}

@media (min-width: 768px) {
    .plant-form-container {
        padding: 32px;
    }
}

.plant-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    text-align: center;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

@media (min-width: 768px) {
    .plant-title {
        font-size: 30px;
    }
}

.plant-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    position: relative;
}

.form-icon {
    position: absolute;
    left: 12px;
    top: 14px;
    color: var(--gray-500);
}

.form-input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    outline: none;
}

.form-input:focus {
    box-shadow: 0 0 0 2px var(--secondary);
}

.form-select {
    width: 100%;
    padding: 12px 40px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-300);
    color: var(--gray-500);
    appearance: none;
    outline: none;
}

.form-select:focus {
    box-shadow: 0 0 0 2px var(--secondary);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 14px;
    color: var(--gray-500);
    pointer-events: none;
}

.form-button {
    width: 100%;
    background-color: var(--secondary);
    color: var(--black);
    font-weight: 700;
    padding: 12px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-button:hover {
    background-color: #eab308;
}

.form-button:focus {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}
/* Footer styles - S M Samiul Hasan */
.footer {
    background-color: var(--darkGreen);
    color: var(--white);
    padding: 24px 16px;
    text-align: center;
    border-top: 1px solid var(--gray-700);
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-text {
    font-size: 14px;
}

/* Modal styles - S M Samiul Hasan */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 32px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1001;
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Ensure modal  */
#modal-title {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--gray-800);
}

#modal-description {
    color: var(--gray-600);
    margin-bottom: 16px;
    line-height: 1.6;
}


/* Responsive styles - S M Samiul Hasan */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar, .cart-sidebar {
        width: 100%;
        max-height: none;
    }
    
    .trees-grid {
        grid-template-columns: 1fr;
    }
    
    nav {
        flex-direction: column;
        gap: 16px;
    }
    
    .about-content {
        flex-direction: column;
        height: auto;
    }
    
    .about-img-placeholder, .about-text {
        margin-top: 0;
    }
    
    .impact-grid {
        grid-template-columns: 1fr; 
    }
}