/* Mobile-First Responsive Styles for GrassDirect */

/* Base mobile styles - applies to all screen sizes unless overridden */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile Navigation Styles */
.mobile-nav-toggle {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background-color 0.3s ease;
}

.mobile-nav-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.98), rgba(21, 128, 61, 0.98));
    backdrop-filter: blur(10px);
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-nav-menu.active {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.mobile-nav-links {
    padding: 1rem 0;
}

.mobile-nav-link {
    display: block;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    padding-left: 2rem;
}

.mobile-nav-link svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    vertical-align: middle;
}

.mobile-nav-badge {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    min-width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-dropdown {
    background-color: rgba(0, 0, 0, 0.1);
}

.mobile-nav-dropdown-item {
    padding-left: 3rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Mobile-First Form Styles */
.form-container {
    padding: 1rem;
    max-width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-button {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    display: block;
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.form-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.form-button:active {
    transform: translateY(0);
}

.form-button.secondary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

.form-button.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Mobile Card Styles */
.mobile-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    overflow: hidden;
}

.mobile-card-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #f9fafb, #f3f4f6);
}

.mobile-card-body {
    padding: 1rem;
}

.mobile-card-footer {
    padding: 1rem;
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

/* Mobile Product Grid */
.mobile-product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
}

.mobile-product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mobile-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.mobile-product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.mobile-product-info {
    padding: 1rem;
}

.mobile-product-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.mobile-product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 1rem;
}

/* Mobile Tables */
.mobile-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
    background: white;
}

.mobile-table th,
.mobile-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
}

.mobile-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Mobile List View (alternative to tables) */
.mobile-list {
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mobile-list-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.mobile-list-item:last-child {
    border-bottom: none;
}

.mobile-list-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.mobile-list-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.mobile-list-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.mobile-list-action {
    flex: 1;
    padding: 0.5rem;
    background: #f3f4f6;
    border: none;
    border-radius: 0.375rem;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-list-action:hover {
    background: #e5e7eb;
}

.mobile-list-action.primary {
    background: #10b981;
    color: white;
}

.mobile-list-action.primary:hover {
    background: #059669;
}

/* Mobile Typography */
.mobile-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.mobile-subheading {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* Mobile Spacing */
.mobile-container {
    padding: 0 1rem;
    max-width: 100%;
}

.mobile-section {
    margin-bottom: 2rem;
}

/* Mobile Status Badges */
.mobile-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.mobile-status-badge.success {
    background-color: #d1fae5;
    color: #065f46;
}

.mobile-status-badge.warning {
    background-color: #fef3c7;
    color: #92400e;
}

.mobile-status-badge.error {
    background-color: #fee2e2;
    color: #991b1b;
}

.mobile-status-badge.info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Touch-friendly interactions */
.mobile-touchable {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Loading states */
.mobile-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.mobile-spinner {
    width: 2rem;
    height: 2rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tablet Styles */
@media (min-width: 640px) {
    .mobile-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1.5rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .mobile-container {
        padding: 0 1.5rem;
    }
}

/* Desktop Styles */
@media (min-width: 768px) {
    /* Hide mobile navigation elements */
    .mobile-nav-toggle {
        display: none;
    }

    .mobile-nav-menu {
        display: flex !important;
        position: static;
        background: none;
        backdrop-filter: none;
        border-radius: 0;
        box-shadow: none;
        max-height: none;
        overflow: visible;
    }

    .mobile-nav-links {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0;
    }

    .mobile-nav-link {
        display: flex;
        align-items: center;
        padding: 0.5rem 0.75rem;
        border-bottom: none;
        border-radius: 0.5rem;
        white-space: nowrap;
    }

    .mobile-nav-link:hover {
        padding-left: 0.75rem;
    }

    .mobile-nav-dropdown {
        background: none;
    }

    .mobile-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        padding: 2rem;
    }

    .form-container {
        padding: 2rem;
        max-width: 500px;
        margin: 0 auto;
    }

    .form-button {
        width: auto;
        display: inline-block;
        padding: 0.75rem 2rem;
        margin-right: 1rem;
    }

    .mobile-container {
        padding: 0 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .mobile-product-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .mobile-product-image {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mobile-card {
        background: #1f2937;
        color: white;
    }

    .mobile-card-header {
        background: #374151;
        border-color: #4b5563;
    }

    .mobile-table {
        background: #1f2937;
        color: white;
    }

    .mobile-table th {
        background: #374151;
        color: #e5e7eb;
    }

    .mobile-list {
        background: #1f2937;
    }

    .mobile-list-item {
        border-color: #4b5563;
    }

    .form-input {
        background: #374151;
        border-color: #4b5563;
        color: white;
    }
}

/* Print styles */
@media print {
    .mobile-nav-toggle,
    .mobile-nav-menu,
    .form-button {
        display: none !important;
    }

    .mobile-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}