/* Custom Styles for Planting Guide System */

/* Import Montserrat Font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

/* Apply Montserrat font globally */
html,
body {
    font-family: Poppins,'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Ensure all elements inherit Montserrat */
*,
*::before,
*::after {
    font-family: inherit;
}

/* Explicitly set font for common elements */
h1, h2, h3, h4, h5, h6,
p, span, div, a, button,
input, textarea, select, label,
.navbar, .card, .btn, .form-control,
.table, .modal, .alert, .badge {
    font-family: Poppins,'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin: 0.25rem 0.5rem;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
}

/* Main Content */
main {
    margin-top: 56px;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* Tables */
.table {
    background-color: white;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Badges */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Navbar */
.navbar {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Dashboard Cards */
.card.text-white {
    border-radius: 0.5rem;
    transition: transform 0.2s;
}

.card.text-white:hover {
    transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 767.98px) {
    .sidebar {
        position: relative;
        top: 0;
        padding: 0;
    }
    
    main {
        margin-top: 0;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Print Styles */
@media print {
    .sidebar,
    .navbar,
    .btn,
    .card-header .btn {
        display: none !important;
    }
    
    main {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sidebar icon enhancements */
.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.75rem;
    transition: transform 0.2s ease;
}

.sidebar .nav-link:hover i {
    transform: scale(1.1);
}

.sidebar .nav-link.active i {
    color: inherit;
}

/* Responsive Site Name */
.navbar-brand {
    font-weight: 100;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-flex;
    align-items: center;
}

.navbar-brand i {
    flex-shrink: 0;
    margin-right: 0.5rem;
}

/* Auto-truncate site name on mobile */
@media (max-width: 991.98px) {
    .navbar-brand {
        max-width: calc(100vw - 140px);
        text-overflow: ellipsis;
        overflow: hidden;
    }
}

/* Smaller screens - more aggressive truncation */
@media (max-width: 575.98px) {
    .navbar-brand {
        max-width: calc(100vw - 120px);
        font-size: 0.9rem;
    }
}

/* Very small screens - show minimal text */
@media (max-width: 400px) {
    .navbar-brand {
        max-width: calc(100vw - 100px);
        font-size: 0.8rem;
    }
}

