:root {
    --primary-color: #2E8B57;
    /* SeaGreen */
    --secondary-color: #20B2AA;
    /* LightSeaGreen */
    --accent-color: #FF7F50;
    /* Coral */
    --background-color: #F5FFFA;
    /* MintCream */
    --text-color: #333;
    --card-bg: #fff;
    --font-heading: 'Outfit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-body: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--background-color);
    font-family: var(--font-body);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

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

header {
    margin-bottom: 3rem;
}

h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
    transition: transform 0.3s ease;
}

.hero-image:hover {
    transform: scale(1.02);
}

.welcome-msg {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin: 2rem 0;
}

.instagram-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    margin: 3rem auto;
    max-width: 800px;
}

.instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.instagram-link:hover {
    color: #E1306C;
}

.market-info {
    margin: 4rem 0;
}

.market-table {
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0 10px;
    width: 100%;
    max-width: 800px;
}

.market-table tr {
    background: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.market-table tr:hover {
    transform: translateY(-2px);
}

.market-table td {
    padding: 1.5rem;
    font-size: 1.2rem;
    color: var(--text-color);
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.market-table td:first-child {
    border-left: 1px solid #eee;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    font-weight: bold;
    color: var(--primary-color);
}

.market-table td:last-child {
    border-right: 1px solid #eee;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.products-section {
    margin-top: 4rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    justify-content: center;
    padding: 2rem 0;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

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

.product-name {
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

footer {
    margin-top: 4rem;
    padding: 2rem;
    background: var(--primary-color);
    color: white;
}

/* Report Page Styles */
.report-page {
    background-color: #f0f4f8;
    /* Slightly darker mint/grey for contrast */
}

.report-container {
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-radius: 16px;
    padding: 3rem;
}

.report-section {
    margin-bottom: 4rem;
    text-align: center;
}

.report-section h2 {
    font-size: 2rem;
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
}

.report-section h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.btn-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: background-color 0.3s;
}

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

.report-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

.report-image.small {
    max-width: 512px;
}

.report-image.medium {
    max-width: 1024px;
}

.report-image.large {
    max-width: 1200px;
}

/* Dataframe/Table Styles (matching included HTML class) */
.table-responsive {
    overflow-x: auto;
    margin: 0 auto;
    display: inline-block;
    max-width: 100%;
}

.dataframe {
    border-collapse: collapse;
    margin: 0 auto;
    font-size: 0.9rem;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dataframe th,
.dataframe td {
    padding: 12px 15px;
    border: 1px solid #eee;
}

.dataframe thead tr {
    background-color: var(--primary-color);
    color: white;
    text-align: left;
}

.dataframe tbody tr:nth-of-type(even) {
    background-color: #f8f9fa;
}

.dataframe tbody tr:hover {
    background-color: #e9ecef;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    justify-content: center;
}

.spacer {
    height: 3rem;
}

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

/* Tablet styles (max-width: 1024px) */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 1.5rem;
    }

    .report-container {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 1.5rem;
    }
}

/* Mobile styles (max-width: 768px) */
@media screen and (max-width: 768px) {
    body {
        font-size: 16px;
        /* Better readability on mobile */
    }

    .container {
        padding: 1rem;
    }

    .report-container {
        padding: 1.5rem 1rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
        border-radius: 8px;
    }

    /* Typography adjustments */
    h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .welcome-msg {
        font-size: 1.2rem;
        margin: 1.5rem 0;
    }

    /* Header adjustments */
    header {
        margin-bottom: 2rem;
    }

    /* Images - ensure they're responsive */
    .hero-image {
        max-width: 100%;
        height: auto;
    }

    /* Instagram section */
    .instagram-section {
        padding: 1.5rem;
        margin: 2rem auto;
    }

    .instagram-link {
        font-size: 1rem;
    }

    /* Market table - stack on mobile */
    .market-table {
        display: block;
        width: 100%;
    }

    .market-table tr {
        display: block;
        margin-bottom: 1rem;
        border-radius: 8px;
        overflow: hidden;
    }

    .market-table td {
        display: block;
        padding: 0.75rem 1rem;
        border: none;
        border-radius: 0;
        text-align: left;
    }

    .market-table td:first-child {
        background-color: var(--primary-color);
        color: white;
        font-weight: bold;
        border-radius: 0;
    }

    .market-table td:last-child {
        border-radius: 0;
    }

    /* Product grid */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0;
    }

    .product-card {
        max-width: 400px;
        margin: 0 auto;
    }

    /* Gallery grid for reports */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Report sections */
    .report-section {
        margin-bottom: 3rem;
    }

    .report-section h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .report-section h3 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
    }

    /* Ensure report images are mobile-friendly */
    .report-image,
    .report-image.small,
    .report-image.medium,
    .report-image.large {
        max-width: 100%;
        width: 100%;
        height: auto;
    }

    /* Table responsiveness */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
        max-width: 100%;
    }

    .dataframe {
        font-size: 0.8rem;
        min-width: 600px;
        /* Allow horizontal scroll for wide tables */
    }

    .dataframe th,
    .dataframe td {
        padding: 8px 10px;
    }

    /* Buttons - make them touch-friendly */
    .btn-link {
        min-height: 44px;
        /* iOS recommended minimum touch target */
        padding: 12px 24px;
        font-size: 1rem;
        width: auto;
        display: inline-block;
    }

    /* Login/Auth containers */
    .login-container,
    .auth-container {
        max-width: 100%;
        margin: 2rem auto;
        padding: 1.5rem;
    }

    .form-group input {
        font-size: 16px;
        /* Prevent zoom on iOS */
        padding: 12px;
    }

    .login-btn,
    .submit-btn {
        min-height: 44px;
        font-size: 1rem;
        padding: 14px 30px;
    }

    /* Admin page */
    .admin-container {
        max-width: 100%;
        margin: 2rem auto;
        padding: 1.5rem;
    }

    .upload-btn {
        min-height: 44px;
        font-size: 1rem;
        padding: 12px 25px;
    }

    /* Progress container for admin */
    #progress-container {
        max-height: 60vh;
    }

    #progress-messages {
        font-size: 0.85rem;
        max-height: 50vh;
    }

    /* Footer */
    footer {
        margin-top: 3rem;
        padding: 1.5rem;
    }

    /* Spacing adjustments */
    .market-info {
        margin: 3rem 0;
    }

    .products-section {
        margin-top: 3rem;
    }

    .spacer {
        height: 2rem;
    }
}

/* Small mobile devices (max-width: 480px) */
@media screen and (max-width: 480px) {
    .container {
        padding: 0.75rem;
    }

    .report-container {
        padding: 1rem 0.75rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
    }

    .welcome-msg {
        font-size: 1.1rem;
    }

    .instagram-section {
        padding: 1rem;
    }

    .login-container,
    .auth-container,
    .admin-container {
        padding: 1rem;
        margin: 1rem auto;
    }

    .market-table td {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }

    .dataframe {
        font-size: 0.75rem;
    }

    .btn-link {
        padding: 10px 20px;
        font-size: 0.95rem;
    }

    #progress-messages {
        font-size: 0.8rem;
    }
}

/* Landscape orientation adjustments */
@media screen and (max-height: 500px) and (orientation: landscape) {

    .login-container,
    .auth-container {
        margin: 1rem auto;
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    header {
        margin-bottom: 1rem;
    }
}

/* High DPI displays - ensure images look crisp */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

    .hero-image,
    .product-image,
    .report-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {

    /* Better touch targets */
    a,
    button,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .product-card:hover,
    .market-table tr:hover {
        transform: none;
    }

    /* Add active states instead */
    .product-card:active {
        transform: scale(0.98);
    }

    .btn-link:active,
    .login-btn:active,
    .submit-btn:active,
    .upload-btn:active {
        opacity: 0.8;
    }
}