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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2d5016 0%, #68b347 100%);
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(45, 80, 22, 0.3);
}

.title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

.date-display {
    font-size: 1.1rem;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

/* Navigation Styles */
.nav-tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.nav-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: fit-content;
}

.nav-tab:hover {
    background: #f3f4f6;
    color: #374151;
}

.nav-tab.active {
    background: #2d5016;
    color: white;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.3);
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

/* Button Styles */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-primary {
    background: #2d5016;
    color: white;
}

.btn-primary:hover {
    background: #1e3610;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.3);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

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

.btn-danger {
    background: #dc2626;
    color: white;
}

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

/* Card Styles */
.activity-card, .crop-card, .weather-card, .expense-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #68b347;
    transition: all 0.3s ease;
}

.activity-card:hover, .crop-card:hover, .weather-card:hover, .expense-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.card-date {
    color: #6b7280;
    font-size: 0.9rem;
}

.card-content {
    color: #4b5563;
    margin-bottom: 12px;
}

.card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: #6b7280;
}

.activity-type {
    display: inline-block;
    padding: 4px 8px;
    background: #e0f2e7;
    color: #2d5016;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Crops Grid */
.crops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.crop-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.status-planted {
    background: #dbeafe;
    color: #1e40af;
}

.status-growing {
    background: #dcfce7;
    color: #166534;
}

.status-ready {
    background: #fef3c7;
    color: #92400e;
}

/* Weather Cards */
.weather-condition {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.weather-detail {
    text-align: center;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
}

.weather-detail-label {
    font-size: 0.8rem;
    color: #6b7280;
}

.weather-detail-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

/* Expenses */
.expenses-summary {
    margin-bottom: 24px;
}

.summary-card {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.summary-card h3 {
    margin-bottom: 8px;
    opacity: 0.9;
}

.amount {
    font-size: 2rem;
    font-weight: 700;
}

.expense-category {
    display: inline-block;
    padding: 4px 8px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.expense-amount {
    font-size: 1.2rem;
    font-weight: 600;
    color: #dc2626;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
}

.close {
    color: #9ca3af;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close:hover {
    color: #374151;
    background: #f3f4f6;
}

/* Form Styles */
form {
    padding: 24px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2d5016;
    box-shadow: 0 0 0 3px rgba(45, 80, 22, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.empty-state-description {
    font-size: 1rem;
    margin-bottom: 24px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 8px;
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 16px;
    }

    .title {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .date-display {
        font-size: 0.95rem;
        padding: 6px 12px;
    }

    .nav-tabs {
        padding: 4px;
        margin-bottom: 16px;
    }

    .nav-tab {
        font-size: 0.85rem;
        padding: 8px 10px;
        min-width: auto;
        flex: 1;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        margin-bottom: 16px;
    }

    .section-header h2 {
        font-size: 1.3rem;
    }

    .crops-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h3 {
        font-size: 1.1rem;
    }

    form {
        padding: 16px;
    }

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

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 0.95rem;
    }

    .card-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-meta {
        flex-direction: column;
        gap: 8px;
        font-size: 0.85rem;
    }

    .activity-card, .crop-card, .weather-card, .expense-card {
        padding: 16px;
        margin-bottom: 12px;
    }

    .weather-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .weather-detail {
        padding: 6px;
    }

    .weather-detail-label {
        font-size: 0.75rem;
    }

    .weather-detail-value {
        font-size: 1rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 16px;
        padding-top: 16px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .summary-card {
        padding: 16px;
    }

    .summary-card h3 {
        font-size: 1rem;
    }

    .amount {
        font-size: 1.6rem;
    }

    .empty-state {
        padding: 40px 16px;
    }

    .empty-state-icon {
        font-size: 3rem;
    }

    .empty-state-title {
        font-size: 1.1rem;
    }

    .empty-state-description {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 4px;
    }

    .header {
        padding: 12px;
        margin-bottom: 16px;
    }

    .title {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .date-display {
        font-size: 0.85rem;
        padding: 4px 8px;
    }

    .nav-tabs {
        padding: 2px;
        margin-bottom: 12px;
    }

    .nav-tab {
        font-size: 0.8rem;
        padding: 6px 8px;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .modal-content {
        margin: 2% auto;
        width: 98%;
        max-height: 98vh;
    }

    .modal-header {
        padding: 12px;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    form {
        padding: 12px;
    }

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

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 8px;
        font-size: 0.9rem;
    }

    .activity-card, .crop-card, .weather-card, .expense-card {
        padding: 12px;
        margin-bottom: 8px;
    }

    .card-title {
        font-size: 0.95rem;
    }

    .card-meta {
        font-size: 0.8rem;
    }

    .weather-details {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .weather-detail {
        padding: 4px;
    }

    .weather-detail-value {
        font-size: 0.9rem;
    }
    
    .amount {
        font-size: 1.4rem;
    }

    .summary-card {
        padding: 12px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .empty-state {
        padding: 30px 12px;
    }

    .empty-state-icon {
        font-size: 2.5rem;
    }

    .empty-state-title {
        font-size: 1rem;
    }

    .empty-state-description {
        font-size: 0.85rem;
    }

    .close {
        font-size: 24px;
        width: 28px;
        height: 28px;
    }
}

/* Extra small devices (portrait phones, less than 375px) */
@media (max-width: 374px) {
    .title {
        font-size: 1.1rem;
    }

    .nav-tab {
        font-size: 0.75rem;
        padding: 5px 6px;
    }

    .section-header h2 {
        font-size: 1.1rem;
    }

    .activity-card, .crop-card, .weather-card, .expense-card {
        padding: 10px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .amount {
        font-size: 1.2rem;
    }
}

/* Large tablets and small desktops */
@media (min-width: 769px) and (max-width: 1024px) {
    .crops-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .weather-details {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }

    .nav-tab {
        min-height: 44px;
        padding: 12px 16px;
    }

    .close {
        min-width: 44px;
        min-height: 44px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        padding: 12px;
    }
}

/* Improve scrolling on mobile */
@media (max-width: 768px) {
    .modal-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
}