/* static/style.css */
/* استایل سفارشی پروژه Smart Agriculture Assistant */
/* نسخه نهایی با بهبود کامل دارک مود، دکمه همبرگر و انیمیشن */

/* ==================== Font & Base ==================== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

* {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
}

body {
    background: #FBF5DD;
    color: #273338;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==================== Navbar ==================== */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: #9CB080 !important;
}

.navbar-brand i {
    margin-left: 8px;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    color: #273338 !important;
    transition: all 0.2s ease;
    border-radius: 10px;
    margin: 0 2px;
}

.nav-link:hover {
    color: #9CB080 !important;
    background: rgba(156, 176, 128, 0.1);
}

.nav-link i {
    margin-left: 6px;
    font-size: 0.9rem;
}

.dropdown-menu {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 8px;
}

.dropdown-item {
    border-radius: 8px;
    padding: 8px 16px;
}

.dropdown-item:hover {
    background: rgba(156, 176, 128, 0.1);
    color: #9CB080;
}

.navbar-text {
    font-size: 0.85rem;
    background: rgba(156, 176, 128, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
}

/* ==================== Cards ==================== */
.card {
    border: none;
    border-radius: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.08) !important;
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* ==================== Buttons ==================== */
.btn {
    border-radius: 14px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #9CB080;
    border-color: #9CB080;
}

.btn-primary:hover {
    background: #7a8f60;
    border-color: #7a8f60;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(156, 176, 128, 0.3);
}

.btn-outline-primary {
    color: #9CB080;
    border-color: #9CB080;
}

.btn-outline-primary:hover {
    background: #9CB080;
    border-color: #9CB080;
    transform: translateY(-2px);
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background: #1e7e34;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    border-color: #ffc107;
    color: #273338;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

/* ==================== Forms ==================== */
.form-control, .form-select {
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    padding: 12px 16px;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #9CB080;
    box-shadow: 0 0 0 4px rgba(156, 176, 128, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #273338;
}

/* ==================== Alerts ==================== */
.alert {
    border-radius: 16px;
    border: none;
    padding: 14px 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ==================== Tables ==================== */
.table {
    border-radius: 16px;
    overflow: hidden;
}

.table thead th {
    background: #f8f9fa;
    border-bottom: none;
    font-weight: 600;
    padding: 15px;
}

.table tbody tr:hover {
    background: rgba(156, 176, 128, 0.05);
}

/* ==================== Footer ==================== */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    margin-top: 3rem;
    padding: 1.5rem 0;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    .navbar-brand i {
        font-size: 1.2rem;
    }
    .card {
        border-radius: 20px;
    }
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    h1, h2, h3 {
        font-size: 1.3rem;
    }
    .display-4 {
        font-size: 2rem;
    }
}

/* ==================== Utilities ==================== */
.rounded-3 {
    border-radius: 16px !important;
}
.rounded-4 {
    border-radius: 24px !important;
}
.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}
.cursor-pointer {
    cursor: pointer;
}
.font-monospace {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.pulse {
    animation: pulse 0.5s ease-in-out;
}

/* ==================== Dark Mode Toggle Button ==================== */
.dark-mode-toggle {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #273338;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 0.8rem;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}
.dark-mode-toggle:hover {
    transform: scale(1.05);
}

/* ==================== Dark Mode Styles (Improved) ==================== */
body.dark-mode {
    background: #121212;
    color: #f0f0f0;
}
body.dark-mode .card,
body.dark-mode .navbar,
body.dark-mode .footer {
    background: #1e1e2e;
    color: #f0f0f0;
}
body.dark-mode .card-header {
    border-bottom-color: #2a2a3e;
}
body.dark-mode .text-muted {
    color: #b0b0c0 !important;
}
body.dark-mode .form-control,
body.dark-mode .form-select {
    background: #2a2a3e;
    border-color: #4a4a5e;
    color: #ffffff;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
    background: #2a2a3e;
    color: #ffffff;
    border-color: #9CB080;
}
body.dark-mode .form-label {
    color: #e0e0e0;
}
body.dark-mode .table {
    color: #e0e0e0;
}
body.dark-mode .table thead th {
    background: #2a2a3e;
    color: #e0e0e0;
    border-bottom-color: #3a3a4e;
}
body.dark-mode .table tbody tr:hover {
    background: rgba(156, 176, 128, 0.15);
}
body.dark-mode .bg-light {
    background: #2a2a3e !important;
    color: #e0e0e0;
}
body.dark-mode .bg-light .text-muted {
    color: #c0c0d0 !important;
}
body.dark-mode .status-excellent {
    background: #1a3a1a;
    color: #a0e0a0;
}
body.dark-mode .status-good {
    background: #1a2a3a;
    color: #a0c0e0;
}
body.dark-mode .status-warning {
    background: #3a2a1a;
    color: #e0c080;
}
body.dark-mode .status-critical {
    background: #3a1a1a;
    color: #e0a0a0;
}
body.dark-mode .weather-current {
    background: #2a2a3e;
}
body.dark-mode .hourly-table {
    background: #2a2a3e;
}
body.dark-mode .hourly-table .bg-light {
    background: #1e1e2e !important;
    color: #e0e0e0;
}
body.dark-mode .btn-outline-primary {
    color: #9CB080;
    border-color: #9CB080;
}
body.dark-mode .btn-outline-primary:hover {
    background: #9CB080;
    color: #121212;
}
body.dark-mode .alert-success {
    background: #1a3a1a;
    color: #a0e0a0;
}
body.dark-mode .alert-danger {
    background: #3a1a1a;
    color: #e0a0a0;
}
body.dark-mode .alert-warning {
    background: #3a2a1a;
    color: #e0c080;
}
body.dark-mode .alert-info {
    background: #1a2a3a;
    color: #a0c0e0;
}
body.dark-mode .dropdown-menu {
    background: #2a2a3e;
    color: #e0e0e0;
}
body.dark-mode .dropdown-item {
    color: #e0e0e0;
}
body.dark-mode .dropdown-item:hover {
    background: #3a3a4e;
    color: #9CB080;
}
body.dark-mode .navbar-text {
    background: rgba(156, 176, 128, 0.2);
    color: #e0e0e0;
}
body.dark-mode .nav-link {
    color: #e0e0e0 !important;
}
body.dark-mode .nav-link:hover {
    color: #9CB080 !important;
    background: rgba(156, 176, 128, 0.2);
}
body.dark-mode .btn-warning {
    background: #b8860b;
    border-color: #b8860b;
    color: #ffffff;
}
body.dark-mode .btn-warning:hover {
    background: #9a6a0a;
}
body.dark-mode .btn-success {
    background: #1e7e34;
}
body.dark-mode .btn-danger {
    background: #a71d2a;
}
/* Navbar toggler button for dark mode */
body.dark-mode .navbar-toggler {
    background-color: #9CB080;
    border-color: #9CB080;
}
body.dark-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
/* Stat cards in dark mode */
body.dark-mode .stat-card {
    background: #2a2a3e;
}
body.dark-mode .stat-card .text-muted {
    color: #b0b0c0 !important;
}
/* Rule and alert rule details in dark mode */
body.dark-mode .rule-details,
body.dark-mode .alert-rule-details {
    background: #2a2a3e !important;
}
body.dark-mode .alert-sms-preview {
    background: #1e1e2e;
    color: #e0e0e0;
}
body.dark-mode .empty-state {
    background: #1e1e2e;
}
body.dark-mode .day-card.selected-day {
    background-color: #6b8c5e;
    color: white;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #9CB080;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #7a8f60;
}
body.dark-mode ::-webkit-scrollbar-track {
    background: #2a2a3e;
}
body.dark-mode ::-webkit-scrollbar-thumb {
    background: #9CB080;
}

/* ==================== Print Styles ==================== */
@media print {
    .navbar, .footer, .btn, .dark-mode-toggle {
        display: none;
    }
    body {
        background: white;
        color: black;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
