/**
 * Garden Couties - Styles
 */

:root {
    --primary: #4a7c59;
    --primary-dark: #3d6b4a;
    --primary-light: #6b9b7a;
    --secondary: #8b4513;
    --secondary-light: #a0522d;
    --accent: #f4a460;
    --bg-light: #f5f5dc;
    --bg-dark: #e8e0c8;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --white: #ffffff;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --radius: 12px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-dark) 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

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

.page-header {
    text-align: center;
    margin-bottom: 30px;
}

.page-header h1 {
    color: var(--primary-dark);
    font-size: 2rem;
    margin-bottom: 5px;
}

.page-header p {
    color: var(--text-light);
}

/* ========== NAVBAR ========== */
.navbar {
    background: var(--primary);
    padding: 15px 20px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--accent);
}

.navbar-nav {
    display: flex;
    gap: 10px;
    list-style: none;
}

.navbar-nav a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 8px;
    transition: all 0.3s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: var(--primary-dark);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--white);
}

.navbar-balance {
    background: var(--primary-dark);
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
}

/* ========== CARDS ========== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 1.2rem;
    color: var(--primary-dark);
}

/* ========== GRID ========== */
.grid {
    display: grid;
    gap: 20px;
}

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

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

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

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

.btn-success:hover {
    background: #219a52;
}

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

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 5px;
}

/* ========== PLANT CARDS ========== */
.plant-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

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

.plant-card-ready {
    box-shadow: 0 0 0 3px var(--success), var(--shadow);
}

.plant-card-ready:hover {
    box-shadow: 0 0 0 3px var(--success), 0 4px 15px rgba(39, 174, 96, 0.3);
}

.plant-quantity-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.plant-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.plant-info {
    padding: 15px;
}

.plant-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.plant-fruit {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.plant-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-growing {
    background: #fff3cd;
    color: #856404;
}

.status-ready {
    background: #d4edda;
    color: #155724;
}

.status-harvested {
    background: #e2e3e5;
    color: #383d41;
}

.plant-progress {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.plant-progress-bar {
    height: 100%;
    background: var(--success);
    transition: width 0.3s;
}

/* ========== MARKET ========== */
.price-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.price-fruit {
    font-size: 3rem;
    margin-bottom: 10px;
}

.price-name {
    font-weight: bold;
    color: var(--primary-dark);
    margin-bottom: 5px;
}

.price-value {
    font-size: 1.5rem;
    color: var(--success);
    font-weight: bold;
}

.price-unit {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== INVENTORY ========== */
.inventory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 10px;
}

.inventory-fruit {
    display: flex;
    align-items: center;
    gap: 15px;
}

.inventory-emoji {
    font-size: 2rem;
}

.inventory-name {
    font-weight: bold;
}

.inventory-qty {
    color: var(--text-light);
}

.inventory-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== TABLES ========== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--primary-dark);
}

.table tr:hover {
    background: var(--bg-light);
}

/* ========== STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    color: var(--text-light);
    margin-top: 5px;
}

/* ========== AUTH PAGES ========== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    color: var(--primary);
    font-size: 2rem;
}

.auth-logo p {
    color: var(--text-light);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: var(--white);
    font-weight: 500;
    transform: translateX(120%);
    transition: transform 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateX(0);
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }

/* ========== LOADING ========== */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-dark);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-title {
    font-size: 1.3rem;
    color: var(--primary-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

/* ========== PIX ========== */
.pix-container {
    text-align: center;
    padding: 20px;
}

.pix-qrcode {
    max-width: 250px;
    margin: 20px auto;
}

.pix-qrcode img {
    width: 100%;
    border-radius: 8px;
}

.pix-copy {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 8px;
    word-break: break-all;
    font-family: monospace;
    font-size: 0.8rem;
    margin: 15px 0;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

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

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-dark);
}

/* ========== BADGE ========== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-light); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

/* ========== MARKET TABS ========== */
.market-tabs {
    display: flex;
    gap: 5px;
    background: var(--white);
    padding: 5px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== PRICE CHANGE INDICATORS ========== */
.price-change {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
    padding: 3px 8px;
    border-radius: 4px;
}

.price-up {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.price-down {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

/* ========== CHART STYLES ========== */
.chart-period-btns {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.period-btn {
    padding: 8px 16px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

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

.period-btn.active {
    background: var(--primary);
    color: var(--white);
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px;
    border-top: 1px solid #eee;
}

.chart-stat-card {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.stat-emoji {
    font-size: 1.5rem;
}

.stat-name {
    font-weight: 600;
    color: var(--text-dark);
}

.stat-price {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-change {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 8px 0;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
}

.stat-up {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.15);
}

.stat-down {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.15);
}

.stat-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 8px;
}

/* ========== RESPONSIVE CHART ========== */
@media (max-width: 768px) {
    .chart-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-period-btns {
        justify-content: center;
    }

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

/* ========== TRADING CHART STYLES (Light Theme) ========== */
.trading-controls {
    background: var(--white);
    border: none;
    padding: 0;
    box-shadow: var(--shadow);
}

.trading-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}

.trading-pair {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trading-select {
    background: var(--bg-light);
    border: 1px solid #ddd;
    color: var(--text-dark);
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.trading-select:focus {
    outline: none;
    border-color: var(--primary);
}

.trading-pair-label {
    color: var(--text-light);
    font-size: 1rem;
}

.trading-price-display {
    display: flex;
    align-items: center;
    gap: 15px;
}

#current-price-display {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-dark);
}

.price-change-badge {
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-up {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.badge-down {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.trading-chart-card {
    background: var(--white);
    border: none;
    box-shadow: var(--shadow);
}

.trading-chart-container {
    height: 400px;
    padding: 20px;
    background: var(--white);
}

.empty-chart {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Trading Stats Bar */
.trading-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px 20px;
    background: var(--bg-light);
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}

.trading-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.trading-stat .stat-label {
    color: var(--text-light);
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.trading-stat .stat-value {
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
}

.trading-stat .stat-high {
    color: #27ae60;
}

.trading-stat .stat-low {
    color: #e74c3c;
}

.trading-stat .stat-up {
    color: #27ae60;
    background: transparent;
}

.trading-stat .stat-down {
    color: #e74c3c;
    background: transparent;
}

/* Make price cards clickable */
.price-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.price-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* ========== RESPONSIVE TRADING ========== */
@media (max-width: 768px) {
    .trading-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .trading-price-display {
        width: 100%;
        justify-content: space-between;
    }

    .trading-chart-container {
        height: 350px;
        padding: 10px;
    }

    .trading-stats {
        justify-content: flex-start;
        gap: 15px;
    }

    .trading-stat {
        min-width: 70px;
    }
}

/* ========== REFERRAL SECTION ========== */
.stat-mini {
    background: var(--bg-light);
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
}

.stat-mini .stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-dark);
}

.stat-mini .stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 5px;
}

.referral-stats-grid {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .referral-stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   PAYMENT METHOD SELECTOR
   ======================================== */

.payment-method-selector {
    margin: 20px 0;
}

.payment-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.payment-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option:hover:not(.disabled) {
    border-color: var(--primary);
}

.payment-option.active {
    border-color: var(--primary);
    background: rgba(76, 175, 80, 0.1);
}

.payment-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.payment-icon {
    font-size: 1.5rem;
}

.payment-label {
    font-weight: 600;
    color: var(--text);
}

.payment-balance {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 500;
}

/* ========================================
   RESPONSIVE MOBILE STYLES
   ======================================== */

/* ========== MOBILE NAVIGATION ========== */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 110;
    order: 3;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--white);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

.navbar-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.navbar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-overlay.show {
    display: block;
    opacity: 1;
}

/* ========== RESPONSIVE TYPOGRAPHY ========== */
.page-header h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    line-height: 1.2;
}

.card-title {
    font-size: clamp(1rem, 3vw, 1.2rem);
}

.modal-title {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
}

.stat-value {
    font-size: clamp(1.5rem, 6vw, 2rem);
    word-break: break-word;
}

.price-value {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
}

#current-price-display {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
}

/* ========== RESPONSIVE TABLES ========== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 15px;
    position: relative;
}

.table-responsive .table {
    min-width: 600px;
}

/* ========== TOUCH-FRIENDLY BUTTONS ========== */
.btn {
    min-height: 44px;
}

.btn-sm {
    min-height: 40px;
    padding: 8px 14px;
}

.quantity-btn {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.tab-btn {
    min-height: 48px;
}

.form-control {
    min-height: 48px;
}

.trading-select {
    min-height: 48px;
}

.period-btn {
    min-height: 44px;
    padding: 10px 18px;
}

/* ========== TABLET LANDSCAPE (1024px) ========== */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========== TABLET PORTRAIT (768px) ========== */
@media (max-width: 768px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar-content {
        flex-wrap: wrap;
    }

    .navbar-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 80px 20px 20px;
        gap: 5px;
        transition: right 0.3s ease;
        z-index: 100;
        box-shadow: -2px 0 10px rgba(0,0,0,0.2);
        list-style: none;
    }

    .navbar-nav.open {
        right: 0;
    }

    .navbar-nav li {
        width: 100%;
    }

    .navbar-nav a {
        display: block;
        padding: 15px 20px;
        font-size: 1.1rem;
        border-radius: 8px;
        width: 100%;
    }

    .navbar-user {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--primary);
        padding: 15px 20px;
        flex-direction: row;
        justify-content: space-between;
        border-top: 1px solid var(--primary-dark);
        z-index: 101;
        gap: 10px;
    }

    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    /* Modal bottom sheet */
    .modal-overlay {
        align-items: flex-end;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: var(--radius) var(--radius) 0 0;
        padding: 20px;
        animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 0 auto 15px;
    }

    .modal-header {
        position: sticky;
        top: 0;
        background: var(--white);
        margin: -20px -20px 15px;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        z-index: 1;
    }

    /* Charts responsivos */
    .trading-chart-container {
        height: clamp(250px, 45vh, 350px);
        padding: 10px;
    }

    /* Toast no topo em mobile */
    .toast {
        bottom: auto;
        top: 20px;
        right: 20px;
        left: 20px;
        transform: translateY(-120%);
        text-align: center;
    }

    .toast.show {
        transform: translateY(0);
    }
}

/* ========== MOBILE LARGE (600px) ========== */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .grid-4,
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
    }

    .card {
        padding: 15px;
    }

    /* Inventory mobile */
    .inventory-item {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .inventory-fruit {
        justify-content: flex-start;
    }

    .inventory-actions {
        justify-content: space-between;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }

    /* Trading stats grid */
    .trading-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px;
    }

    .trading-stat {
        min-width: unset;
    }

    .trading-stat .stat-label {
        font-size: 0.65rem;
    }

    .trading-stat .stat-value {
        font-size: 0.85rem;
    }

    /* Shop plants grid dentro do modal */
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* ========== MOBILE SMALL (480px) ========== */
@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .navbar {
        padding: 10px 15px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-balance {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .container {
        padding: 12px;
    }

    .page-header {
        margin-bottom: 20px;
    }

    .page-header p {
        font-size: 0.9rem;
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Plant cards */
    .plant-card {
        border-radius: 8px;
    }

    .plant-image {
        height: 120px;
        font-size: 3rem;
    }

    .plant-info {
        padding: 12px;
    }

    .plant-name {
        font-size: 1rem;
    }

    .plant-fruit {
        font-size: 0.8rem;
    }

    .plant-quantity-badge {
        padding: 4px 10px;
        font-size: 0.8rem;
    }

    .status-badge {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    /* Price cards */
    .price-card {
        padding: 15px;
    }

    .price-fruit {
        font-size: 2.5rem;
    }

    /* Buttons */
    .btn {
        padding: 12px 18px;
        font-size: 0.95rem;
    }

    .btn-block {
        padding: 14px 20px;
    }

    /* Modal */
    .modal {
        max-height: 90vh;
        padding: 15px;
    }

    /* Trading header */
    .trading-header {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
    }

    .trading-pair {
        width: 100%;
    }

    .trading-select {
        flex: 1;
    }

    .trading-price-display {
        width: 100%;
        justify-content: space-between;
    }

    /* Chart */
    .trading-chart-container {
        height: clamp(180px, 40vh, 280px);
        padding: 8px;
    }

    .chart-period-btns {
        overflow-x: auto;
        padding: 10px 15px;
        gap: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .period-btn {
        flex-shrink: 0;
        padding: 8px 14px;
        font-size: 0.85rem;
        min-height: 40px;
    }

    /* Auth pages */
    .auth-card {
        padding: 25px 20px;
        margin: 10px;
        border-radius: 16px;
    }

    .auth-logo h1 {
        font-size: 1.6rem;
    }

    .auth-logo {
        margin-bottom: 25px;
    }

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

    /* Table */
    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* ========== TOUCH FEEDBACK ========== */
.price-card {
    -webkit-tap-highlight-color: transparent;
}

.price-card:active {
    transform: scale(0.98);
}

.btn:active {
    transform: scale(0.97);
}

@media (hover: none) {
    .plant-card:hover {
        transform: none;
    }

    .price-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
}

/* ========== SAFE AREA (iPhone Notch) ========== */
@supports (padding-top: env(safe-area-inset-top)) {
    .navbar {
        padding-top: calc(15px + env(safe-area-inset-top));
    }

    @media (max-width: 768px) {
        .navbar-user {
            padding-bottom: calc(15px + env(safe-area-inset-bottom));
        }

        .modal {
            padding-bottom: calc(20px + env(safe-area-inset-bottom));
        }

        .toast {
            top: calc(20px + env(safe-area-inset-top));
        }
    }
}
