/* EkoKeeper Custom Styles - Reptile Feeder Bug Products */

/* Custom Tailwind Colors */
:root {
    --eco-green: #22c55e;
    --eco-dark: #0f172a;
    --eco-light: #f8fafc;
    --eco-green-rgb: 34, 197, 94;
    --eco-dark-rgb: 15, 23, 42;
}

/* Hero Section Styles */
.gradient-bg {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #16a34a 80%, #22c55e 100%);
    position: relative;
}

.gradient-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(22, 163, 74, 0.7) 50%, rgba(34, 197, 94, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.1) 1px, transparent 0);
    background-size: 20px 20px;
}

/* Product Selection Styles */
.color-swatch {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation; /* Improves mobile touch performance */
}

@media (max-width: 768px) {
    .color-swatch {
        width: 50px;
        height: 50px;
    }
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.selected {
    border-color: var(--eco-green);
    box-shadow: 0 0 0 2px rgba(var(--eco-green-rgb), 0.2);
}

/* Card Styles */
.product-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.glass-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Button Effects */
.btn-glow {
    box-shadow: 0 0 20px rgba(var(--eco-green-rgb), 0.4);
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(var(--eco-green-rgb), 0.6);
}

.btn-eco {
    background: var(--eco-green);
    color: white;
    transition: all 0.3s ease;
}

.btn-eco:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(var(--eco-green-rgb), 0.3);
}

/* Mobile-friendly button improvements */
.model-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px; /* Minimum touch target size for mobile */
}

@media (max-width: 768px) {
    .model-btn {
        min-height: 56px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Larger touch targets for mobile */
    .btn, button {
        min-height: 44px;
        font-size: 16px;
    }
    
    /* Better mobile navigation */
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Mobile Navigation Improvements */
#mobile-menu {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#mobile-menu a:hover,
#mobile-menu button:hover {
    transform: translateX(4px);
}

/* Mobile Menu Animation */
.mobile-menu-item {
    animation: slideInFromRight 0.3s ease-out;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Mobile User Section Styling */
#mobile-user-section {
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(22, 163, 74, 0.05) 100%);
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

/* Page Header Styles */
.page-header {
    background: linear-gradient(135deg, var(--eco-dark) 0%, #1e293b 50%, var(--eco-green) 100%);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    z-index: 1;
}

.page-header-content {
    position: relative;
    z-index: 2;
}

/* Navigation Enhancements */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--eco-green);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Improve mobile menu visibility */
@media (max-width: 768px) {
    #mobile-menu {
        backdrop-filter: blur(20px);
    }
    
    /* Prevent content shift on menu open */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Content Sections */
.content-section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--eco-dark);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    margin-bottom: 3rem;
}

/* Bug-specific Styles */
.bug-category-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.bug-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: var(--eco-green);
}

.bug-icon {
    width: 4rem;
    height: 4rem;
    background: var(--eco-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.5rem;
}

/* Feature Cards */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .hero-content {
        padding: 2rem 0;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Utility Classes */
.text-eco-green {
    color: var(--eco-green);
}

.text-eco-dark {
    color: var(--eco-dark);
}

.bg-eco-green {
    background-color: var(--eco-green);
}

.bg-eco-dark {
    background-color: var(--eco-dark);
}

.bg-eco-light {
    background-color: var(--eco-light);
}

.border-eco-green {
    border-color: var(--eco-green);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--eco-green);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

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

/* Announcement Banner Styles */
.announcement-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(90deg, var(--eco-green) 0%, #16a34a 50%, var(--eco-green) 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-out;
    height: 40px;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-banner.hidden {
    transform: translateY(-100%);
}

.announcement-scroll {
    white-space: nowrap;
    animation: scroll-text 25s linear infinite;
    display: inline-block;
    padding: 0 20px;
    line-height: 1;
}

@keyframes scroll-text {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

.announcement-banner .close-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10000;
    line-height: 1;
    flex-shrink: 0;
}

.announcement-banner .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Header and Banner Integration */
header {
    transition: transform 0.3s ease-in-out;
}

/* Adjust content spacing based on banner visibility */
.banner-offset {
    padding-top: calc(4rem + 40px) !important; /* nav height + banner height */
}

body:not(.banner-visible) .banner-offset {
    padding-top: 4rem !important; /* just nav height */
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .announcement-banner {
        height: 36px;
        font-size: 13px;
        padding: 0 8px;
    }
    
    .banner-offset {
        padding-top: calc(4rem + 36px) !important; /* nav height + mobile banner height */
    }
    
    body:not(.banner-visible) .banner-offset {
        padding-top: 4rem !important;
    }
    
    .announcement-banner .close-btn {
        width: 22px;
        height: 22px;
        font-size: 14px;
        right: 8px;
        border-radius: 50%;
        min-width: 22px;
        min-height: 22px;
    }
    
    .announcement-scroll {
        padding: 0 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .announcement-banner {
        height: 32px;
        font-size: 12px;
        padding: 0 6px;
    }
    
    .banner-offset {
        padding-top: calc(4rem + 32px) !important; /* nav height + small mobile banner height */
    }
    
    body:not(.banner-visible) .banner-offset {
        padding-top: 4rem !important;
    }
    
    .announcement-banner .close-btn {
        width: 20px;
        height: 20px;
        font-size: 12px;
        right: 6px;
        border-radius: 50%;
        min-width: 20px;
        min-height: 20px;
    }
    
    .announcement-scroll {
        padding: 0 10px;
        font-size: 12px;
    }
}

/* 📱 ADMIN DASHBOARD MOBILE ENHANCEMENTS */

/* Improved mobile buttons for admin dashboard */
@media (max-width: 768px) {
    /* INVENTORY SECTION MOBILE FIX - Keep it professional! */
    
    /* Smaller, more mobile-friendly action buttons */
    #inventory-panel .bg-eco-green,
    #inventory-panel .bg-blue-500,
    button[onclick="addInventoryItem()"],
    button[onclick="refreshInventory()"] {
        padding: 8px 12px !important;
        font-size: 14px !important;
        min-height: 40px !important;
    }
    
    /* Make button container responsive */
    #inventory-panel .flex.gap-3 {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }
    
    #inventory-panel .flex.gap-3 button {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* Header section mobile improvements */
    #inventory-panel .flex.justify-between.items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    #inventory-panel h2 {
        font-size: 1.25rem !important;
        margin-bottom: 0 !important;
    }
    
    /* Summary cards - two columns on mobile */
    #inventory-panel .grid.grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }
    
    /* RESPONSIVE INVENTORY CARDS - Remove scroll if items fit */
    #inventory-groups {
        /* Remove forced horizontal scroll - let it be natural */
        padding-bottom: 4px !important;
    }
    
    /* Individual inventory group cards - more compact */
    #inventory-groups .bg-white {
        margin-bottom: 12px !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Product header in groups - much more compact */
    #inventory-groups .bg-gray-50 {
        padding: 8px 12px !important;
        border-radius: 8px 8px 0 0 !important;
    }
    
    #inventory-groups .bg-gray-50 h3 {
        font-size: 0.9rem !important;
        margin-bottom: 2px !important;
        font-weight: 600 !important;
    }
    
    /* ORIGINAL INVENTORY DESIGN - Keep original desktop, mobile-friendly mobile */
    #inventory-groups {
        padding-bottom: 8px !important;
    }

    /* Individual inventory product cards */
    #inventory-groups .bg-white {
        margin-bottom: 20px !important;
        border-radius: 8px !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
        overflow: hidden !important;
    }

    /* Product header */
    #inventory-groups .bg-gray-50 {
        padding: 16px 20px !important;
        border-radius: 8px 8px 0 0 !important;
        background: #f9fafb !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    #inventory-groups .bg-gray-50 h3 {
        font-size: 1.1rem !important;
        margin-bottom: 6px !important;
        font-weight: 600 !important;
        color: #1f2937 !important;
    }

    /* Original grid layout - responsive */
    #inventory-groups .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
        gap: 16px !important;
        padding: 20px !important;
    }

    /* Individual variant cards - keep original design but make mobile-friendly */
    #inventory-groups .grid > div {
        background: #ffffff !important;
        border: 1px solid #e5e7eb !important;
        border-radius: 8px !important;
        padding: 16px !important;
        transition: all 0.2s ease !important;
        min-height: 180px !important;
    }

    /* Stock-based color coding - keep original colors */
    #inventory-groups .grid > div.stock-high {
        border-left: 4px solid #22c55e !important;
        background: #f0fdf4 !important;
    }

    #inventory-groups .grid > div.stock-medium {
        border-left: 4px solid #f59e0b !important;
        background: #fffbeb !important;
    }

    #inventory-groups .grid > div.stock-low {
        border-left: 4px solid #ef4444 !important;
        background: #fef2f2 !important;
    }

    #inventory-groups .grid > div.stock-empty {
        border-left: 4px solid #6b7280 !important;
        background: #f9fafb !important;
    }

    /* Mobile responsive improvements - change to list layout on mobile only */
    @media (max-width: 767px) {
        /* Mobile: Convert to simple list layout */
        #inventory-groups .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
            display: block !important;
            padding: 16px !important;
        }
        
        /* Mobile: Convert grid cards to simple list items */
        #inventory-groups .grid > div {
            border: none !important;
            border-radius: 0 !important;
            padding: 12px 0 !important;
            background: transparent !important;
            border-bottom: 1px solid #f3f4f6 !important;
            min-height: auto !important;
            margin-bottom: 0 !important;
        }
        
        #inventory-groups .grid > div:last-child {
            border-bottom: none !important;
        }
        
        /* Mobile: Stock-based coloring - subtle left border */
        #inventory-groups .grid > div.stock-high {
            border-left: 3px solid #22c55e !important;
            padding-left: 15px !important;
            background: #f0fdf4 !important;
            margin-left: -3px !important;
            border-bottom: 1px solid #f3f4f6 !important;
        }

        #inventory-groups .grid > div.stock-medium {
            border-left: 3px solid #f59e0b !important;
            padding-left: 15px !important;
            background: #fffbeb !important;
            margin-left: -3px !important;
            border-bottom: 1px solid #f3f4f6 !important;
        }

        #inventory-groups .grid > div.stock-low {
            border-left: 3px solid #ef4444 !important;
            padding-left: 15px !important;
            background: #fef2f2 !important;
            margin-left: -3px !important;
            border-bottom: 1px solid #f3f4f6 !important;
        }

        #inventory-groups .grid > div.stock-empty {
            border-left: 3px solid #6b7280 !important;
            padding-left: 15px !important;
            background: #f9fafb !important;
            margin-left: -3px !important;
            border-bottom: 1px solid #f3f4f6 !important;
        }
        
        /* Mobile: Simplify the grid layout inside cards */
        #inventory-groups .grid > div .grid.grid-cols-3 {
            display: flex !important;
            justify-content: space-between !important;
            text-align: left !important;
        }
        
        /* Mobile: Smaller header sections */
        #inventory-groups .bg-gray-50 {
            padding: 12px 16px !important;
        }
        
        /* Mobile: Very small screens - stack some elements */
        @media (max-width: 480px) {
            #inventory-groups .grid > div .flex.justify-between {
                flex-direction: column !important;
                align-items: flex-start !important;
                gap: 8px !important;
            }
        }
    }

    /* General admin improvements */
    .admin-btn, 
    button[type="submit"], 
    button[type="button"],
    .btn-primary,
    .btn-secondary {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
        touch-action: manipulation;
    }
    
    /* Small action buttons */
    .btn-sm, 
    .action-btn {
        min-height: 40px !important;
        min-width: 40px !important;
        padding: 8px 10px !important;
    }
    
    /* Stats cards - better mobile layout */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .stat-card {
        padding: 16px 12px !important;
        text-align: center !important;
    }
    
    /* Table responsiveness improvements for regular tables */
    .admin-table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 8px !important;
        border: 1px solid #e5e7eb !important;
        margin: 0 -16px !important;
    }
    
    .admin-table {
        min-width: 800px !important; /* Ensure table doesn't get too cramped */
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 6px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
    
    /* Form inputs - better mobile experience */
    .admin-input,
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 10px 14px !important;
        border-radius: 6px !important;
    }
    
    /* Modal improvements for mobile */
    .admin-modal {
        margin: 8px !important;
        max-height: calc(100vh - 32px) !important;
        overflow-y: auto !important;
    }
    
    .modal-content {
        padding: 16px !important;
    }
    
    .modal-footer {
        flex-direction: column !important;
    }
    
    .modal-footer button {
        width: 100% !important;
        margin: 4px 0 !important;
    }
    
    /* Tab navigation - mobile friendly */
    .admin-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .admin-tab {
        min-width: 120px !important;
        padding: 12px 16px !important;
        white-space: nowrap !important;
    }
    
    /* Spacing improvements */
    .admin-section {
        padding: 16px 12px !important;
        margin-bottom: 16px !important;
    }
}

/* Small screen specific (phones in portrait) */
@media (max-width: 480px) {
    /* Single column layout for stats */
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Smaller padding for very small screens */
    .admin-section {
        padding: 12px 8px !important;
    }
    
    /* Compact table for small screens */
    .admin-table th,
    .admin-table td {
        padding: 8px 4px !important;
        font-size: 12px !important;
    }
    
    /* Stack button groups vertically */
    .button-group {
        flex-direction: column !important;
    }
    
    .button-group button {
        margin: 2px 0 !important;
        width: 100% !important;
    }
}

/* Touch improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Better touch targets */
    .clickable,
    button,
    .btn,
    a:not(.no-touch) {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .hover-effect:hover {
        transform: none !important;
    }
    
    /* Better focus states for touch */
    button:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 2px solid #22c55e !important;
        outline-offset: 2px !important;
    }
}
