/* assets/css/style.css */

:root {
    --primary: #1b4332;
    --primary-hover: #143225;
    --primary-light: #2d6a4f;
    --accent: #40916c;
    --accent-light: #d8f3dc;
    --bg-light: #f4f9f4;
    --bg-white: #ffffff;
    --text-dark: #1a202c;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --card-shadow: 0 10px 25px rgba(27, 67, 50, 0.05);
    --hover-shadow: 0 15px 35px rgba(27, 67, 50, 0.1);
    --border-radius: 12px;
    --success: #2e7d32;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Header & Navigation */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: white;
}

.logo-container img {
    height: 50px;
    background: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.logo-container h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.80);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover, .nav-links a.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

/* Main Layout */
.main-container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
}

.page-title h2 {
    font-size: 28px;
    color: var(--primary);
    font-weight: 700;
}

.page-title p {
    color: var(--text-muted);
    font-size: 15px;
}

/* Dashboard Cards / Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stats-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: var(--primary);
}

.stats-card.accent::before {
    background: var(--accent);
}

.stats-card.info::before {
    background: #3182ce;
}

.stats-icon {
    font-size: 32px;
    background: var(--bg-light);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.stats-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stats-info p {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

/* UI Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-light);
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Plant Card View */
.plants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.plant-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.plant-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.plant-card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    padding: 20px;
    color: white;
    position: relative;
}

.plant-card-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.plant-card-location {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.plant-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Card States (View / Edit Mode) */
.plant-card-view-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.plant-card-edit-mode {
    display: none;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
}

.plant-card.editing .plant-card-view-mode {
    display: none !important;
}

.plant-card.editing .plant-card-edit-mode {
    display: flex !important;
}

/* Inline Form Elements inside Card */
.card-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.card-form-control {
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 14px;
    background-color: #fafdfa;
}

.card-form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(45, 106, 79, 0.1);
}

.plant-spec {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 8px;
}

.plant-spec:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.plant-spec-label {
    color: var(--text-muted);
    font-weight: 500;
}

.plant-spec-value {
    color: var(--text-dark);
    font-weight: 600;
}

.plant-card-qty-badge {
    background-color: var(--accent-light);
    color: var(--primary);
    padding: 8px 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    margin: 10px 0;
}

.plant-card-footer {
    padding: 12px 20px;
    background: #fafdfa;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* View toggle buttons */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(27, 67, 50, 0.15);
}

.btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(27, 67, 50, 0.25);
}

.btn-secondary {
    background-color: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background-color: var(--bg-light);
    color: var(--primary-hover);
}

.btn-accent {
    background-color: var(--accent);
}

.btn-accent:hover {
    background-color: var(--primary-light);
}

.btn-danger {
    background-color: var(--danger);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background: var(--bg-white);
}

th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    padding: 15px 20px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 15px;
    color: #4a5568;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: var(--bg-light);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-location {
    background-color: var(--accent-light);
    color: var(--primary);
}

.badge-qty {
    background-color: #ebf8ff;
    color: #2b6cb0;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fafdfa;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.15);
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Multi-select check grid for profile reporting */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: #fafafa;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.checkbox-item:hover {
    background-color: var(--accent-light);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Search bar styling */
.search-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex-grow: 1;
}


/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s;
    outline: none;
    align-items: center;
    justify-content: center;
}

.hamburger-btn:hover {
    color: var(--accent-light);
}

/* --- RESPONSIVE & MOBILE UPGRADES (COMPLETE PORTING) --- */

@media (max-width: 992px) {
    header {
        padding: 15px 25px;
    }
    
    .logo-container h1 {
        font-size: 18px;
    }
    
    .nav-links {
        gap: 10px;
    }
    
    .nav-links a {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        position: relative;
    }
    
    .logo-container {
        justify-content: flex-start;
    }
    
    /* Hamburger Menu Button Display */
    .hamburger-btn {
        display: flex;
    }
    
    /* Dropdown vertical navigation drawer */
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
        padding: 15px 20px;
        gap: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 150;
        overflow-x: visible;
        white-space: normal;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-links a {
        font-size: 14px;
        padding: 10px 15px;
        background-color: rgba(255, 255, 255, 0.05);
        width: 100%;
        justify-content: flex-start;
    }
    
    .main-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 15px;
    }
    
    .page-header .btn {
        width: 100%;
    }
    
    .card {
        padding: 20px;
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    .logo-container img {
        height: 40px;
    }
    
    .logo-container h1 {
        font-size: 15px;
    }
    
    .page-title h2 {
        font-size: 22px;
    }
    
    .page-title p {
        font-size: 13px;
    }
    
    /* Double column compact grid for stats on mobile */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 25px;
    }
    
    .stats-card {
        padding: 15px 12px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }
    
    .stats-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .stats-info h3 {
        font-size: 10px;
        letter-spacing: 0;
    }
    
    .stats-info p {
        font-size: 18px;
    }
    
    /* Plant Card mobile padding adjustments */
    .plant-card-header {
        padding: 15px;
    }
    
    .plant-card-body {
        padding: 15px;
        gap: 8px;
    }
    
    .plant-card-qty-badge {
        font-size: 14px;
        padding: 6px;
        margin: 6px 0;
    }
    
    .plant-card-footer {
        padding: 10px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .plant-card-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 8px;
    }
    
    /* Settings layout and tabs */
    .tab-menu {
        gap: 5px;
        margin-bottom: 20px;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Inputs stacking */
    form button[type="submit"] {
        width: 100%;
    }
    
    /* Checkbox grid scroll height */
    .checkbox-grid {
        grid-template-columns: 1fr;
        max-height: 250px;
    }
}

/* Print styling */
@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }
    header, .btn, .no-print, form, .search-container, .view-toggle, .plant-card-footer {
        display: none !important;
    }
    body {
        background-color: white;
        color: black;
    }
    .main-container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
    .card {
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
    }
    .table-responsive {
        border: none;
        overflow: visible;
    }
    table {
        border: 1px solid #ddd;
        width: 100%;
        border-collapse: collapse;
    }
    th {
        background-color: #f2f2f2 !important;
        color: black !important;
        border-bottom: 2px solid #333;
        border-top: 1px solid #ddd;
        border-left: 1px solid #ddd;
        border-right: 1px solid #ddd;
    }
    td {
        border: 1px solid #ddd;
        padding: 8px 12px;
    }
}

/* Inline Editing Forms Styling */
.inline-edit-container {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.inline-edit-input {
    padding: 6px 10px;
    font-size: 14px;
    height: 34px;
    flex-grow: 1;
}

.inline-edit-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.inline-edit-actions button {
    padding: 6px 12px;
    height: 34px;
}

/* Mobile Settings Zoom and Inputs Fixing */
@media (max-width: 768px) {
    /* Prevent iOS auto zoom: inputs and select dropdowns must be at least 16px */
    input, select, textarea, .form-control, .card-form-control, .inline-edit-input {
        font-size: 16px !important;
    }

    /* Make inline edit form inputs occupy separate rows to be spacious on mobile devices */
    .inline-edit-container {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        background-color: #fafafa;
        border: 1px solid var(--border-color);
        padding: 10px;
        border-radius: 8px;
        box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
    }
    
    .inline-edit-input {
        width: 100%;
        height: 44px; /* easy finger-tapping */
        font-size: 16px !important;
    }
    
    .inline-edit-actions {
        width: 100%;
        justify-content: flex-end;
        gap: 8px;
        margin-top: 5px;
    }
    
    .inline-edit-actions button {
        flex: 1;
        height: 40px;
        font-size: 14px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

