/* ===================================
   Forage Tools Modern CSS
   Mobile-First Responsive Design
   =================================== */

/* Root Variables for Consistent Theming */
:root {
    --primary-color: #8c7c62;
    --primary-dark: #6d5f4a;
    --secondary-color: #00c0ef;
    --danger-color: #f56954;
    --success-color: #00a65a;
    --dark-bg: #222d32;
    --light-bg: #f4f6f9;
    --card-shadow: 0 2px 4px rgba(0,0,0,0.1);
    --card-shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-bg);
    color: #333;
    line-height: 1.6;
}

/* Modern Navigation */
.forage-navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 0.75rem 0;
}

.forage-navbar .navbar-brand img {
    transition: transform 0.3s ease;
}

.forage-navbar .navbar-brand:hover img {
    transform: scale(1.05);
}

.forage-navbar .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    border-radius: 4px;
    margin: 0 0.25rem;
}

.forage-navbar .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff !important;
}

.forage-navbar .nav-item.active .nav-link {
    background-color: rgba(255,255,255,0.2);
    color: #fff !important;
}

.forage-navbar .nav-link i {
    margin-right: 0.5rem;
}

/* Dropdown Menu Styling */
.dropdown-menu {
    border: none;
    box-shadow: var(--card-shadow-hover);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1.5rem;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: var(--light-bg);
}

.dropdown-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Container Improvements */
.container {
    max-width: 1200px;
}

/* Modern Card Styling */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    margin-bottom: 2rem;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.btn-outline-light {
    border: 2px solid rgba(255,255,255,0.7);
    color: white;
}

.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: white;
}

/* Tables */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(140, 124, 98, 0.05);
}

.table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

/* Chart Container */
.chart-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 2rem;
}

/* Stats Boxes */
.stats-box {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.stats-box:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-3px);
}

.stats-box h4 {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.stats-box p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.stats-box small {
    color: #999;
    font-size: 0.85rem;
}

/* Page Headings */
h1, h2, h3 {
    color: var(--primary-dark);
    font-weight: 700;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}

/* Info Boxes */
.info-box {
    background-color: white;
    border-left: 4px solid var(--secondary-color);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.info-box p {
    margin-bottom: 0.5rem;
}

.info-box b {
    color: var(--primary-dark);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 3rem 0;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--light-bg);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile Navigation */
    .forage-navbar .navbar-nav {
        margin-top: 1rem;
    }

    .forage-navbar .nav-link {
        padding: 0.75rem 0 !important;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .forage-navbar .navbar-nav.ml-auto {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255,255,255,0.2);
    }

    /* Smaller headings on mobile */
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Stack stats boxes */
    .stats-box {
        margin-bottom: 1rem;
    }

    /* Better table responsiveness */
    .table-responsive {
        border-radius: 8px;
        box-shadow: var(--card-shadow);
    }

    /* Chart height adjustment */
    .chart-container {
        height: auto !important;
        min-height: 250px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 2rem;
    }
}

/* Utility Classes */
.mt-5 {
    margin-top: 3rem !important;
}

.mb-5 {
    margin-bottom: 3rem !important;
}

/* Print Styles */
@media print {
    .forage-navbar,
    .btn,
    .alert {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
