/* Complete Standalone CSS for Crop Recommendation Page */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Color Variables */
:root {
    --primary-color: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --accent: #8BC34A;
    --light-green: #E8F5E9;
    --light-green-hover: #D7EAD8;
    --medium-green: #C8E6C9;
    --white: #ffffff;
    --black: #000000;
    --text-color: #333333;
    --text-light: #666666;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --error: #d32f2f;
    --success: #388e3c;
    --warning: #f9a825;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 12px;
}

/* Typography */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7f5;
    min-height: 100vh;
    font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    margin-bottom: 30px;
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 10px 20px;
    box-shadow: var(--shadow);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
}

.nav-item {
    margin: 0 15px;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary-color);
}

.logo img {
    height: 40px;
}

.back-link {
    color: var(--gray-600);
    margin-right: 15px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-color);
}

.user-profile img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 15px;
    border: 2px solid var(--primary-light);
}

/* Screens and Page Structure */
.screen {
    padding: 20px 0 60px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none;
}

.page-title {
    text-align: center;
    margin-bottom: 40px;
}

.page-title h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
}

.page-title p {
    color: var(--text-light);
    font-size: 1rem;
}

/* Process Steps */
.process-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 50px 0;
    gap: 15px;
}

.process-step {
    background-color: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    flex: 1;
    max-width: 280px;
    position: relative;
    transition: all 0.3s ease;
}

.process-step:hover {
    transform: translateY(-5px);
}

.process-icon {
    background-color: var(--light-green);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.process-icon i {
    font-size: 30px;
    color: var(--primary-color);
}

.process-step h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.process-step p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.step-number {
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
}

.process-arrow {
    color: var(--gray-300);
    font-size: 24px;
}

/* Form Elements */
.input-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
}

.card-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 20px;
    display: flex;
    align-items: center;
}

.card-header i {
    font-size: 24px;
    margin-right: 15px;
}

.card-header h2 {
    font-size: 1.4rem;
    margin: 0;
    font-weight: 500;
    color: var(--white);
}

.card-body {
    padding: 25px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 20px;
}

.form-group {
    flex: 1;
    min-width: 200px;
    padding: 0 10px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--white);
    color: var(--text-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.2);
}

.help-text {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 5px;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    margin-right: 15px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.toggle-label {
    font-weight: 500;
    margin-right: 15px;
}

.soil-help {
    margin-left: 15px;
}

/* Info Box and Climate Inputs */
.info-box {
    background-color: var(--light-green);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.info-box i {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 10px;
    margin-top: 2px;
}

.climate-inputs {
    margin-top: 20px;
    transition: all 0.3s ease;
}

/* Buttons */
.action-button {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}

button {
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button i {
    margin-right: 8px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.primary-btn.accent {
    background-color: var(--primary-light);
}

.primary-btn.accent:hover {
    background-color: var(--primary-dark);
}

.secondary-btn {
    background-color: var(--gray-200);
    color: var(--text-color);
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 1rem;
}

.secondary-btn:hover {
    background-color: var(--gray-300);
}

.location-button {
    background-color: var(--gray-100);
    color: var(--text-color);
    padding: 12px 15px;
    border-radius: 8px;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    border: 1px solid var(--gray-300);
}

.location-button:hover {
    background-color: var(--gray-200);
}

.location-button i {
    margin-right: 8px;
}

.autofill-button {
    background-color: var(--gray-100);
    color: var(--text-color);
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-left: auto;
}

.autofill-button:hover {
    background-color: var(--gray-200);
}

.autofill-button i {
    margin-right: 8px;
}

/* Soil Tips */
.soil-tips {
    background-color: var(--light-green);
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 20px;
}

.soil-tips h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.soil-tips i {
    margin-right: 8px;
    color: var(--primary-color);
}

.soil-tips ul {
    margin-left: 25px;
    font-size: 0.9rem;
}

.soil-tips li {
    margin-bottom: 5px;
}

/* Results Page */
.result-summary {
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.section-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 30px 0 20px;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 10px;
    font-size: 1.1rem;
}

/* Crop Recommendations */
.recommendations-container {
    margin-bottom: 40px;
}

.crop-recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.crop-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.crop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.crop-image {
    height: 180px;
    overflow: hidden;
    background-color: var(--light-green);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.crop-card:hover .crop-image img {
    transform: scale(1.05);
}

.crop-details {
    padding: 15px;
}

.crop-details h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.match-tag {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.match-tag.small {
    font-size: 0.8rem;
}

.match-percent {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 8px;
}

.crop-details p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.info-button {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.info-button:hover {
    background-color: var(--light-green);
}

/* Poly-cropping Section */
.polycropping-container {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.poly-pair {
    background-color: var(--gray-100);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    flex: 1;
}

.poly-crop {
    width: 80px;
    text-align: center;
}

.poly-crop img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.crop-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.plus-sign {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.poly-info {
    flex: 1;
    min-width: 200px;
    padding-left: 15px;
}

.poly-info p {
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Crop Details Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: var(--white);
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: fadeIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.large-modal {
    max-width: 800px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    margin: 0;
    color: var(--white);
}

.modal-header h2 i {
    margin-right: 10px;
}

.close-modal {
    font-size: 1.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: var(--white);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    text-align: right;
    border-top: 1px solid var(--gray-200);
}

/* Crop Modal Details */
.crop-modal-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.crop-modal-image {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

.crop-modal-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.crop-modal-details {
    flex: 2;
    min-width: 250px;
}

.detail-section {
    margin-bottom: 15px;
}

.detail-section h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.crop-care-tips {
    background-color: var(--light-green);
    padding: 15px 20px;
    border-radius: 8px;
}

.crop-care-tips h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.crop-care-tips h3 i {
    margin-right: 8px;
}

.crop-care-tips ul {
    margin-left: 20px;
}

.crop-care-tips li {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Location Group Specific Styles */
.location-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 28px; /* Aligns with other inputs */
}

/* Responsive Styles */
@media (max-width: 768px) {
    .page-title h1 {
        font-size: 1.6rem;
    }
    
    .process-container {
        flex-direction: column;
    }
    
    .process-step {
        max-width: 100%;
    }
    
    .process-arrow {
        transform: rotate(90deg);
    }
    
    .action-button {
        flex-direction: column;
    }
    
    .action-button button {
        width: 100%;
    }
    
    .poly-pair {
        justify-content: center;
    }
    
    .poly-info {
        width: 100%;
        padding-left: 0;
        margin-top: 15px;
    }
    
    .crop-modal-container {
        flex-direction: column;
        align-items: center;
    }
    
    .crop-modal-image {
        max-width: 100%;
    }
    
    .location-group {
        padding-top: 0;
    }
    
    .toggle-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .toggle-container .switch {
        margin-bottom: 10px;
    }
    
    .autofill-button {
        margin: 10px 0 0;
    }
}

@media (max-width: 576px) {
    .nav-container {
        flex-direction: column;
        padding: 15px;
    }
    
    .nav-left, .nav-right {
        width: 100%;
        justify-content: center;
        margin: 5px 0;
    }
    
    .logo {
        margin: 10px 0;
    }
}