/* Import Inter font for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* General Styles */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: #334155;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Hero Header Styles */
.hero-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    color: white;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.5;
}

.hero-content {
    max-width: 800px;
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-highlight {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    margin: 0 0 3rem 0;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Floating Cards */
.hero-visual {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    animation: float 6s ease-in-out infinite;
}

.floating-card i {
    font-size: 1.5rem;
    color: #3b82f6;
}

.card-1 {
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.card-2 {
    bottom: 25%;
    left: 8%;
    animation-delay: 2s;
}

.card-3 {
    top: 60%;
    right: 15%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Regular header for dashboard pages */
header:not(.hero-header) {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
}

main {
    padding: 4rem 2rem;
    text-align: center;
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    flex-grow: 1;
    border-radius: 0;
    margin-top: 0;
    margin-bottom: 0;
    box-shadow: none;
}

/* Section Styles */
.intro-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    margin: 0 -2rem;
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.intro-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1e293b;
}

.intro-content p {
    font-size: 1.125rem;
    color: #64748b;
    line-height: 1.7;
}

.features-section {
    padding: 6rem 0;
}

.section-header {
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1e293b;
}

.section-header p {
    font-size: 1.125rem;
    color: #64748b;
}

.features-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.feature-item {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 20px 20px 0 0;
}

.feature-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
}

.feature-icon i {
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
}

.feature-item h3 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    letter-spacing: -0.01em;
}

.feature-item p {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

.feature-highlight {
    display: inline-block;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1d4ed8;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #93c5fd;
}

/* Benefits Section */
.benefits-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    margin: 0 -2rem;
    color: white;
}

.benefits-section .section-header h2 {
    color: white;
}

.benefits-section .section-header p {
    color: #cbd5e1;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
    padding: 0 2rem;
}

.benefit-item {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.benefit-number {
    font-size: 3rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
    line-height: 1;
}

.benefit-item h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: white;
}

.benefit-item p {
    color: #cbd5e1;
    margin: 0;
    line-height: 1.5;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: white;
}

.footer-section p {
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: #64748b;
    margin: 0;
}

/* Legacy Features Section Styles (for dashboard pages) */
.features-container:not(.hero-header .features-container) {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin: 3rem 0;
    padding: 2rem 0;
}

.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item) {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Responsive canvas sizing */
@media (max-width: 768px) {
    #visualization-section {
        gap: 15px;
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .visualization-item {
        padding: 1rem;
        min-height: auto;
    }
    
    .visualization-window {
        max-width: 100%;
        margin: 0 auto;
        min-width: auto;
        padding: 1rem;
    }
    
    .visualization-window canvas {
        max-width: 100% !important;
        height: auto !important;
        width: auto !important;
    }
    
    #all-points-canvas,
    #heatmap-canvas {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        min-height: 200px;
        border-width: 2px;
    }
    
    .planogram-container {
        max-width: 100%;
        padding: 0.75rem;
    }
    
    #duration-heatmap-canvas,
    #count-heatmap-canvas {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    #visualization-section {
        flex-direction: column;
        gap: 10px;
        margin: 10px auto;
        padding: 0.75rem;
    }
    
    .visualization-item {
        padding: 0.75rem;
    }
    
    .visualization-window {
        padding: 0.75rem;
        min-width: auto;
    }
    
    .visualization-window canvas {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    #all-points-canvas,
    #heatmap-canvas {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        min-height: 180px;
        border-width: 1px;
    }
    
    .planogram-container {
        padding: 0.5rem;
    }
}

/* Legacy feature item styles for dashboard pages */
.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2980b9 0%, #3498db 100%);
    border-radius: 20px 20px 0 0;
}

.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item):hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #f1f3f4 100%);
}

.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item) .feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item):hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 35px rgba(52, 152, 219, 0.4);
}

.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item) .feature-icon i {
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
}

.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item):hover .feature-icon i {
    transform: scale(1.1);
}

.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item) h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0;
    letter-spacing: 0.5px;
}

.feature-item:not(.hero-header .feature-item):not(.features-section .feature-item) p {
    color: #5a6c7d;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    font-weight: 400;
}

/* Custom Styles for Dashboard */
#home-link {
    position: absolute;
    left: 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    background: linear-gradient(135deg, #007BFF 0%, #0056b3 100%);
    padding: 12px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#home-link:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

#logout-button {
    position: absolute;
    right: 20px;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

#logout-button:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

/* Controls Container */
.controls-container {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #dee2e6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 250px;
    flex: 1;
}

/* Form Controls */
label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
    margin: 0;
    letter-spacing: 0.5px;
}

select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 16px;
    background-color: white;
    color: #2c3e50;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
}

select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15), 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* Refresh Button Styles */
.refresh-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    align-self: flex-end;
    margin-bottom: 0;
}

.refresh-btn-round {
    width: 50px;
    height: 50px;
    border: 2px solid #28a745;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    top: 8px;
}

.refresh-btn-round:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    border-color: #1e7e34;
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px) scale(1.05);
}

.refresh-btn-round:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.refresh-btn-round i {
    transition: transform 0.3s ease;
    font-size: 16px;
}

.refresh-btn-round:hover i {
    transform: rotate(180deg);
}

.refresh-btn-round:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.refresh-btn-round:disabled:hover {
    transform: none;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

.refresh-btn-round:disabled i {
    transform: none !important;
}

/* Small Refresh Button Styles */
.refresh-container {
    display: flex;
    justify-content: center;
    align-items: end;
    margin-bottom: 0;
    flex-shrink: 0;
}

.refresh-btn-small {
    padding: 10px 20px;
    border: 2px solid #28a745;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: auto;
    width: fit-content;
    white-space: nowrap;
}

.refresh-btn-small:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    border-color: #1e7e34;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    transform: translateY(-1px);
}

.refresh-btn-small:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.refresh-btn-small i {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.refresh-btn-small:hover i {
    transform: rotate(180deg);
}

.refresh-btn-small:disabled {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.refresh-btn-small:disabled:hover {
    transform: none;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

.refresh-btn-small:disabled i {
    transform: none !important;
}

select:hover:not(:disabled) {
    border-color: #74b9ff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
    border-color: #dee2e6;
}

/* Visualization Section */
.visualization-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
    align-items: stretch;
}

.visualization-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2980b9 0%, #3498db 100%);
    border-radius: 20px 20px 0 0;
}

.visualization-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #f1f3f4;
    transition: all 0.3s ease;
    min-height: 400px;
}

/* Hover effects removed for visualization items */

.visualization-label {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
    padding: 8px 16px;
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    color: white;
    border-radius: 25px;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

/* Override background for heatmap visualization items */
.visualization-item:has(#heatmap-container) {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 1.5rem;
}

/* Hover effects removed for heatmap visualization items */

/* Remove white background from main when heatmap is present */
main:has(#heatmap-container) {
    background: transparent !important;
    box-shadow: none !important;
}

canvas {
    border: 3px solid #e9ecef;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    background: white;
    transition: all 0.3s ease;
    max-width: 100%;
    height: auto;
}

/* Canvas hover effects removed */



/* Visualization Windows - Consistent Styling */
.visualization-window {
    max-width: 500px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.visualization-window canvas {
    width: unset !important;
    height: unset !important;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    background: white;
}

/* Foot heatmaps: width 100% of planogram window, height 40% of planogram window width, no margin-top for seamless connection */
#duration-heatmap-canvas,
#count-heatmap-canvas {
    width: 100% !important;
    height: 0;
    padding-bottom: 40%; /* 40% of width for height */
    margin-top: 0; /* Removed margin to stick to planogram canvas above */
    display: block;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* All Points Visualization */
#all-points-canvas {
    width: auto;
    height: auto;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    background: #fafafa;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Heatmap Visualization */
#heatmap-canvas {
    width: auto;
    height: auto;
    border: 3px solid #e9ecef;
    border-radius: 15px;
    background: #fafafa;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

/* Heatmap container hover effects removed */

/* Blue overlay removed to fix visualization issues */



/* Removed heatmap-group styles - now using visualization-window for consistency */

/* Legacy planogram container for backward compatibility */
.planogram-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: inline-block;
}

.planogram-container canvas {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
}

/* Motion Heatmaps Section Responsive Styles */
#motion-heatmaps-section {
    width: 90%;
    max-width: 1200px;
}

#motion-heatmaps-section > div[style*="flex"] {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0;
    gap: 20px;
}

#motion-heatmaps-section > div[style*="flex"] > div {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

/* Combined visualization container styling */
.combined-visualization-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
}

/* Planogram canvas styling */
#planogram-canvas {
    display: block;
    margin: 0;
    padding: 0;
    border: 3px solid #e9ecef;
    border-radius: 15px 15px 0 0; /* Rounded top corners only */
    background: #fafafa;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    width: 100% !important;
}

/* Floor motion canvas styling - attached to planogram */
#floor-motion-canvas {
    display: block;
    margin: 0;
    padding: 0;
    border: 3px solid #e9ecef;
    border-top: none; /* Remove top border to attach to planogram */
    border-radius: 0 0 15px 15px; /* Rounded bottom corners only */
    background: #fafafa;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    width: 100% !important;
}

/* Ensure foot heatmaps match the width of their corresponding planogram canvases */
.visualization-window {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.visualization-window canvas {
    width: unset !important;
    height: unset !important;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    background: white;
}

/* Single planogram canvas - no stacking needed */

/* Table Styles */
table {
    width: 95%;
    margin: 2rem auto;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
    font-size: 14px;
}

th, td {
    border: none;
    padding: 15px 12px;
    text-align: center;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

tbody tr {
    transition: all 0.3s ease;
}

tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

tbody tr:hover {
    background-color: #e3f2fd;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Summary Section - Hidden to prevent old summary table from appearing */
#summary-section {
    margin: 3rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    display: none !important;
}

#summary-table-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .controls-container {
        flex-wrap: wrap;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .visualization-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem;
    }
    
    .device-status-container {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }
    
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Mobile optimization for header buttons */
    #home-link {
        position: static;
        display: inline-block;
        margin: 0.5rem;
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
        min-width: 44px;
    }
    
    #logout-button {
        position: static;
        display: inline-block;
        margin: 0.5rem;
        padding: 10px 16px;
        font-size: 14px;
        min-height: 44px;
        min-width: 44px;
    }
    
    header h1 {
        order: -1;
        margin-bottom: 1rem;
        font-size: 1.5rem;
    }
    
    .header-buttons {
        display: flex;
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    main {
        padding: 1rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    .main-content, .controls-only {
        margin: 1rem auto;
        padding: 1.5rem;
        border-radius: 15px;
    }
    
    .features-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 2rem 0;
        padding: 1rem 0;
    }
    
    .feature-item {
        padding: 2rem 1.5rem;
    }
    
    .feature-icon {
        width: 70px;
        height: 70px;
    }
    
    .feature-icon i {
        font-size: 1.8rem;
    }
    
    .feature-item h3 {
        font-size: 1.3rem;
    }
    
    .feature-item p {
        font-size: 0.95rem;
    }
    
    .controls-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .visualization-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1rem;
        margin: 2rem 0;
    }
    
    .visualization-item {
        padding: 1rem;
    }
    
    .visualization-label {
        font-size: 16px;
        padding: 6px 12px;
    }
    
    canvas:not(#all-points-canvas):not(#duration-planogram-canvas):not(#count-planogram-canvas):not(#duration-heatmap-canvas):not(#count-heatmap-canvas) {
        /* Remove max-width and height: auto to allow JavaScript sizing */
        /* max-width: 100%; */
        /* height: auto; */
        border-width: 2px;
    }
    
    .device-status-container {
        padding: 1rem;
        margin: 1.5rem 0;
    }
    
    .status-box {
        padding: 12px 24px;
        font-size: 16px;
        min-width: 120px;
    }
    
    #device-last-seen {
        font-size: 14px;
        padding: 10px 16px;
    }
    
    #lidar-status-text {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .summary-table {
        font-size: 14px;
        margin: 1rem 0;
    }
    
    .summary-table th,
    .summary-table td {
        padding: 8px 6px;
    }
    
    select {
        padding: 12px 16px;
        font-size: 15px;
    }
    
    main {
        padding: 1rem;
        margin: 1rem;
    }
    
    #home-link, #logout-button {
        position: static;
        display: inline-block;
        margin: 0.25rem;
        padding: 8px 12px;
        font-size: 13px;
        width: auto;
    }
    
    .header-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    header {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .controls-container {
        padding: 0.75rem;
    }
    
    .visualization-section {
        padding: 0.75rem;
        margin: 1rem 0;
    }
    
    .visualization-item {
        padding: 0.75rem;
    }
    
    .visualization-label {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .device-status-container {
        padding: 0.75rem;
    }
    
    .status-box {
        padding: 10px 20px;
        font-size: 14px;
        min-width: 100px;
    }
    
    canvas:not(#all-points-canvas):not(#duration-planogram-canvas):not(#count-planogram-canvas):not(#duration-heatmap-canvas):not(#count-heatmap-canvas) {
        border-width: 1px;
    }
    
    .summary-table {
        font-size: 12px;
    }
    
    .summary-table th,
    .summary-table td {
        padding: 6px 4px;
    }
}

/* Device Status Section */
.device-status-container {
    margin: 2.5rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.device-status-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c);
    border-radius: 20px 20px 0 0;
}

.status-box {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 30px;
    font-weight: 700;
    color: white;
    text-align: center;
    font-size: 18px;
    margin: 1rem 0;
    min-width: 150px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

#device-last-seen {
    font-size: 16px;
    color: #495057;
    margin-top: 1.5rem;
    font-weight: 500;
    background: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 15px;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Motion Heatmaps Responsive Media Queries */
@media (max-width: 768px) {
    #motion-heatmaps-section {
        width: 95%;
        padding: 15px;
    }
    
    #motion-heatmaps-section > div[style*="flex"] {
        flex-direction: column;
        align-items: center;
    }
    
    #motion-heatmaps-section > div[style*="flex"] > div {
        max-width: 100%;
        min-width: 280px;
    }
    
    .planogram-container {
        max-width: 450px;
        margin-bottom: 20px;
    }
    
    /* Motion heatmap canvases now inherit from visualization-window */
}

@media (max-width: 480px) {
    #motion-heatmaps-section {
        width: 98%;
        padding: 10px;
    }
    
    #motion-heatmaps-section > div[style*="flex"] > div {
        min-width: 250px;
    }
    
    .planogram-container {
        max-width: 400px;
    }
    
    /* Motion heatmap canvases now inherit from visualization-window */
    
    #motion-heatmaps-section h3 {
        font-size: 16px;
    }
    
    #motion-heatmaps-section p {
        font-size: 11px;
    }
}

#lidar-status-container {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 10px;
    border-left: 4px solid #007BFF;
}

#lidar-status-text {
    font-weight: 600;
    font-size: 16px;
    color: #495057;
    padding: 12px 24px;
    background: rgba(255,255,255,0.9);
    border-radius: 25px;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

#lidar-status-text:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

/* Status Colors */
.online {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.offline {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

#heatmap-grid-section {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.heatmap-grid-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    width: 100%;
    align-items: flex-start; /* Ensure top alignment */
}
.visualization-window {
    max-width: 500px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden; /* Ensure content doesn't overflow the container */
    position: relative; /* For proper positioning of child elements */
}
.visualization-window canvas:not(#heatmap-canvas) {
    width: unset !important;
    height: unset !important;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    background: white;
    object-fit: contain; /* Ensure canvas content fits within container */
}
@media (max-width: 1100px) {
    #heatmap-grid-section {
        max-width: 100%;
    }
    .heatmap-grid-row {
        flex-direction: column;
        gap: 24px;
        align-items: center;
    }
    
    /* Ensure footer heatmaps match their planogram width on smaller screens */
    .visualization-window canvas:not(#heatmap-canvas) {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
    }
    
    /* Ensure visualization windows maintain consistent width when stacked */
    .visualization-window {
        width: 100%;
        max-width: 500px;
    }
    
    /* Mobile responsive footer legends */
    .footer-legend .legend-bar.horizontal {
        width: 150px;
        height: 6px;
    }
    
    .footer-legend .legend-labels.horizontal {
        width: 150px;
        font-size: 8px;
        height: 10px;
    }
    
    .footer-legend .legend-labels.horizontal .legend-label-low,
    .footer-legend .legend-labels.horizontal .legend-label-mid,
    .footer-legend .legend-labels.horizontal .legend-label-high {
        font-size: 8px;
    }
    
    .footer-legend .legend-title {
        font-size: 7px;
        margin-bottom: 0px;
    }
}

/* Remove spacing between stacked canvases in planogram & motion heatmap windows */
#duration-planogram-canvas,
#count-planogram-canvas {
    margin-bottom: 0 !important;
    display: block;
}

#duration-heatmap-canvas,
#count-heatmap-canvas {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: block;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    box-sizing: border-box;
}

/* Ensure footer heatmaps are constrained to their container width */
.visualization-window canvas[id*="duration-heatmap-canvas"],
.visualization-window canvas[id*="count-heatmap-canvas"] {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    object-fit: contain;
    background-color: #f8f9fa; /* Light background to make canvas visible */
    border: 1px solid #e9ecef; /* Light border to show canvas boundaries */
    min-height: 100px; /* Ensure minimum height for visibility */
}

/* Footer heatmaps should have a subtle background for visibility */
#duration-heatmap-canvas,
#count-heatmap-canvas {
    background-color: #f8f9fa; /* Light background for visibility */
    border: 1px solid #dee2e6; /* Subtle border */
}

/* Remove gaps between planogram and floor motion visualizations */
#planogram-canvas {
    margin-bottom: 0 !important;
}

/* Remove padding from planogram visualization window */
.heatmap-grid-row:nth-child(3) .visualization-window {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove padding from floor motion visualization window */
.heatmap-grid-row:nth-child(4) .visualization-window {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Ensure seamless connection between planogram and floor motion */
.floor-motion-container .visualization-window {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

/* Visualization mode toggle buttons */
.viz-mode-btn {
    transition: all 0.2s ease;
    font-weight: 500;
    border: 1px solid transparent;
}

.viz-mode-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.viz-mode-btn.active {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.viz-mode-btn:not(.active):hover {
    background: #d1d5db !important;
    color: #1f2937 !important;
}

/* Responsive design for visualization mode toggle */
@media (max-width: 480px) {
    .viz-mode-btn {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.7rem !important;
        gap: 0.2rem !important;
    }
    
    #visualization-mode-toggle > div > div:last-child {
        gap: 0.2rem !important;
    }
}

/* Footer legend positioning - horizontal under each heatmap */
.heatmap-legend.footer-legend {
    position: relative;
    margin-top: 2px;
    margin-bottom: 2px;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding: 1px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 2px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    min-height: auto;
    height: auto;
}

.footer-legend .legend-title {
    font-size: 8px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0px;
    text-align: center;
    padding: 0px;
    line-height: 1;
}

.footer-legend .legend-bar-container.horizontal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    height: auto;
    min-height: 0;
}

.footer-legend .legend-bar.horizontal {
    width: 200px;
    height: 8px;
    border-radius: 4px;
    border: 1px solid #d1d5db;
    margin-bottom: 0px;
}

.footer-legend .legend-labels.horizontal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 200px;
    font-size: 9px;
    color: #6b7280;
    line-height: 1;
    margin-top: 0px;
    padding-top: 0px;
    height: 12px;
    flex-wrap: nowrap;
    position: relative;
}

.footer-legend .legend-labels.horizontal .legend-label-low {
    position: absolute;
    left: 0;
    text-align: left;
}

.footer-legend .legend-labels.horizontal .legend-label-mid {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
}

.footer-legend .legend-labels.horizontal .legend-label-high {
    position: absolute;
    right: 0;
    text-align: right;
}

.footer-legend .legend-labels.horizontal .legend-label-low,
.footer-legend .legend-labels.horizontal .legend-label-mid,
.footer-legend .legend-labels.horizontal .legend-label-high {
    text-align: center;
    flex: 1;
    white-space: nowrap;
    padding: 0px;
    margin: 0px;
    display: inline-block;
    vertical-align: baseline;
    height: auto;
    line-height: 1;
    font-size: 9px;
}

/* Ensure no spacing between stacked canvases in visualization windows */
.visualization-window canvas + canvas {
    margin-top: 0 !important;
}

/* Seamless integration for planogram and floor motion canvases */
#planogram-canvas {
    border-bottom: none !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    margin-bottom: 0 !important;
}

#floor-motion-canvas {
    border-top: none !important;
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    margin-top: 0 !important;
}

/* Combined visualization container styling */
.combined-visualization-container .visualization-window {
    border-radius: 15px;
    overflow: hidden;
}

.combined-visualization-container canvas {
    display: block;
    width: 100%;
}

/* Responsive Design for New Home Page Sections */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .floating-card {
        display: none; /* Hide floating cards on smaller screens */
    }
    
    .features-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
    
    .benefits-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-header {
        padding: 3rem 1rem;
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .intro-section {
        padding: 3rem 0;
        margin: 0 -1rem;
    }
    
    .intro-content h2 {
        font-size: 2rem;
    }
    
    .intro-content p {
        font-size: 1rem;
    }
    
    .features-section {
        padding: 4rem 0;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .features-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .feature-item {
        padding: 2rem 1.5rem;
    }
    
    .benefits-section {
        padding: 4rem 0;
        margin: 0 -1rem;
    }
    
    .benefits-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .benefit-number {
        font-size: 2.5rem;
    }
    
    main {
        padding: 2rem 1rem;
    }
    
    footer {
        padding: 2rem 1rem 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-header {
        padding: 2rem 1rem;
        min-height: 60vh;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .hero-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .intro-content h2 {
        font-size: 1.75rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .feature-item {
        padding: 1.5rem 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        margin: 0 auto 1.5rem;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
    
    .feature-item h3 {
        font-size: 1.25rem;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .benefit-item {
        padding: 1.5rem;
    }
    
    .benefit-number {
        font-size: 2rem;
    }
}

/* Enhanced login button specifically for home page */
#login-button.btn-primary {
    transition: all 0.3s ease;
}

#login-button.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.6);
}

/* Smooth scrolling for the page */
html {
    scroll-behavior: smooth;
}

/* Mobile-First Dashboard Optimizations */
/* =====================================
   Responsive Table System with Card View Fallback
   ===================================== */

/* Base responsive table container */
.responsive-table-container {
    margin: 2rem auto;
    padding: 1rem;
    max-width: 100%;
    overflow: hidden;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

/* Table title styling */
.table-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f3f4f6;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
}

.table-title i {
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    padding: 0.5rem;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* SKU Analysis table icon should be white for better visibility */
#sku-analysis-table-container .table-title i {
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    padding: 0.5rem;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Ensure SKU Analysis summary table uses responsive table container styling */
#sku-analysis-table-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 1.5rem 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* SKU Detail breakdown table styling */
#sku-detail-table-container {
    background: linear-gradient(135deg, #fefefe 0%, #f9fafb 100%);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    margin: 1.5rem 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Different icon styling for detail table */
#sku-detail-table-container .table-title i {
    color: #ffffff;
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    padding: 0.5rem;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Thresholds and Weights table styling */
#thresholds-weights-table-container {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0ea5e9;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.1), 0 2px 4px -1px rgba(14, 165, 233, 0.06);
    margin: 1.5rem 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Thresholds table icon styling */
#thresholds-weights-table-container .table-title i {
    color: #ffffff;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    padding: 0.5rem;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* Enhanced styling for thresholds table rows */
#thresholds-weights-table-container .responsive-table tbody tr {
    transition: all 0.2s ease;
}

#thresholds-weights-table-container .responsive-table tbody tr:hover {
    background-color: #f0f9ff;
    transform: translateX(2px);
}

/* Highlight class names in thresholds table */
#thresholds-weights-table-container .responsive-table tbody tr td:first-child {
    font-weight: 600;
    color: #0c4a6e;
    text-transform: capitalize;
}

/* Mobile card styling for thresholds table */
#thresholds-weights-table-container .data-card {
    border-left: 4px solid #0ea5e9;
}

/* SKU Performance Analytics Section Styles */
.sku-performance-container {
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.sku-performance-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6366f1 0%, #3b82f6 50%, #06b6d4 100%);
    border-radius: 20px 20px 0 0;
}

.sku-performance-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    align-items: end;
}

.sku-performance-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
    flex: 1;
}

.sku-performance-controls .control-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sku-performance-controls select,
.sku-performance-controls input {
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
}

/* Specific styling for date inputs to prevent shape changes */
.sku-performance-controls input[type="date"] {
    padding: 0.875rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    display: block;
    cursor: pointer;
    position: relative;
}

/* Make entire date input area clickable with hover effects */
.sku-performance-controls input[type="date"]:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

/* Ensure consistent styling when control group visibility changes */
#analysis-date-select {
    padding: 0.875rem !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    background: white !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
    display: block !important;
    cursor: pointer !important;
    position: relative !important;
}

/* Make single date selector fully clickable with hover effects */
#analysis-date-select:hover {
    border-color: #3b82f6 !important;
    background: #f8fafc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15) !important;
}

.sku-performance-controls select:focus,
.sku-performance-controls input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Specific focus styling for date inputs */
.sku-performance-controls input[type="date"]:focus,
#analysis-date-select:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Enhanced calendar icon for date inputs - make it more prominent */
.sku-performance-controls input[type="date"]::-webkit-calendar-picker-indicator,
#analysis-date-select::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3e%3c/svg%3e");
    background-size: 22px 22px;
    background-repeat: no-repeat;
    background-position: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.sku-performance-controls input[type="date"]::-webkit-calendar-picker-indicator:hover,
#analysis-date-select::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
}

/* Add visual feedback for the entire clickable area */
.sku-performance-controls input[type="date"]:active,
#analysis-date-select:active {
    transform: translateY(0px) !important;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2) !important;
}

.analyze-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    min-height: 52px;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 200px;
    align-self: stretch;
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, #5b5ff1 0%, #4338ca 100%);
}

.analyze-btn:active:not(:disabled) {
    transform: translateY(0px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.analyze-btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(156, 163, 175, 0.2);
    opacity: 0.7;
}

.chart-toggle-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: #f1f5f9;
    border-radius: 12px;
}

.chart-toggle-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    background: white;
    color: #6b7280;
    border: 2px solid transparent;
}

.chart-toggle-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #3b82f6;
}

.chart-toggle-btn:hover:not(.active) {
    background: #e2e8f0;
    color: #374151;
}

.charts-container {
    position: relative;
}

.chart-container {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chart-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-info {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

.chart-wrapper {
    position: relative;
    height: 400px;
    margin-bottom: 1rem;
    background: #fafbfc;
    border-radius: 8px;
    padding: 1rem;
}

.chart-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
}

/* Mobile Responsive Styles for SKU Performance */
@media (max-width: 768px) {
    .sku-performance-container {
        padding: 1.5rem;
        margin: 1rem 0;
        border-radius: 16px;
    }
    
    .sku-performance-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        align-items: stretch;
    }
    
    .sku-performance-controls .control-group {
        min-width: unset;
        flex: none;
    }
    
    .analyze-btn {
        min-width: unset;
        width: 100%;
        margin-top: 0.5rem;
        font-size: 0.875rem;
        padding: 0.875rem 1.5rem;
    }
    
    .chart-toggle-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .chart-toggle-btn {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .chart-wrapper {
        height: 300px;
        padding: 0.5rem;
    }
    
    .chart-stats {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.75rem;
    }
    
    .stat-item {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    
    .stat-value {
        font-size: 1.125rem;
    }
}

#thresholds-weights-table-container .data-card:hover {
    border-left-color: #0284c7;
    transform: translateY(-2px);
}

/* Enhanced styling for detail table rows */
#sku-detail-table-container .responsive-table tbody tr {
    transition: all 0.2s ease;
}

#sku-detail-table-container .responsive-table tbody tr:hover {
    background-color: #f8fafc;
    transform: translateX(2px);
}

/* Highlight high-value SKUs in detail table */
#sku-detail-table-container .responsive-table tbody tr td:last-child {
    font-weight: 600;
    color: #1f2937;
}

/* Mobile card styling for detail table */
#sku-detail-table-container .data-card {
    border-left: 4px solid #6b7280;
}

#sku-detail-table-container .data-card:hover {
    border-left-color: #3b82f6;
    transform: translateY(-2px);
}

/* Style the SKU badge containers for better mobile display */
#sku-analysis-table-container .table-card-value div,
#sku-analysis-table-container td div {
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

#sku-analysis-table-container .table-card-value div span,
#sku-analysis-table-container td div span {
    white-space: nowrap;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.3);
    transition: all 0.2s ease;
}

#sku-analysis-table-container .table-card-value div span:hover,
#sku-analysis-table-container td div span:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

/* Mobile responsiveness for SKU badges */
@media (max-width: 768px) {
    #sku-analysis-table-container .table-card-value div,
    #sku-analysis-table-container td div {
        justify-content: flex-start;
        max-width: 100%;
    }
    
    #sku-analysis-table-container .table-card-value div span,
    #sku-analysis-table-container td div span {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

/* Loading states */
.table-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #6b7280;
}

.table-loading .loading-spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

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

/* Error states */
.table-error {
    padding: 2rem;
    text-align: center;
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Standard table for desktop */
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.responsive-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #374151;
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid #d1d5db;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.responsive-table td {
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    vertical-align: top;
}

.responsive-table tr:hover {
    background-color: #f9fafb;
}

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

/* Card view for mobile devices */
.card-view {
    display: none; /* Hidden by default, shown on mobile */
    flex-direction: column;
    gap: 1rem;
}

.data-card {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.data-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

.card-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.card-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 0 0 auto;
    margin-right: 1rem;
}

.card-value {
    color: #1f2937;
    font-weight: 500;
    text-align: right;
    flex: 1;
    word-break: break-word;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #374151;
}

/* Enhanced Mobile Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem;
    display: none;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    min-width: 60px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: #3b82f6;
    background: #eff6ff;
}

.mobile-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

/* Touch-friendly UI improvements */
.touch-friendly {
    min-height: 44px; /* Apple's recommended touch target size */
    min-width: 44px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* Enhanced button styles for mobile */
button,
.btn {
    min-height: 44px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Improved form controls for mobile */
select,
input[type="text"],
input[type="email"],
input[type="password"] {
    min-height: 44px;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px; /* Prevents zoom on iOS */
    background: white;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

select:focus,
input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Device status improvements */
.device-status {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.status-label {
    font-weight: 600;
    color: #374151;
}

.status-value {
    color: #6b7280;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
}

/* Enhanced canvas container for mobile */
.canvas-container {
    position: relative;
    margin: 1.5rem 0;
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.canvas-container canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    border-radius: 8px;
    touch-action: pan-x pan-y pinch-zoom;
}

.canvas-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* Summary section mobile optimization */
#summary-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.summary-item {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    text-align: center;
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.summary-label {
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
    .responsive-table-container {
        margin: 1rem;
        padding: 1rem 0.75rem;
    }
    
    .table-title {
        font-size: 1.25rem;
    }
    
    .responsive-table th,
    .responsive-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    /* Hide standard table, show card view by default on mobile */
    .table-responsive {
        display: none !important;
    }
    
    .table-cards {
        display: block !important;
    }
    
    .responsive-table {
        display: none;
    }
    
    .card-view {
        display: flex;
    }
    
    /* Show mobile navigation */
    .mobile-nav {
        display: block;
    }
    
    /* Add bottom padding to main content to account for mobile nav */
    main,
    .dashboard-content {
        padding-bottom: 5rem;
    }
    
    /* Mobile-specific adjustments */
    .responsive-table-container {
        margin: 1rem 0.5rem;
        padding: 1rem;
        border-radius: 8px;
    }
    
    .table-title {
        font-size: 1.125rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .data-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .card-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 0.75rem 0;
    }
    
    .card-label {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .card-value {
        text-align: left;
        font-size: 0.95rem;
    }
    
    /* Canvas adjustments for mobile */
    .canvas-container {
        margin: 1rem 0;
        padding: 0.75rem;
    }
    
    .canvas-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Device status mobile layout */
    .device-status {
        margin: 1rem 0.5rem;
        padding: 1rem;
    }
    
    .status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .status-value {
        font-size: 0.8rem;
        word-break: break-all;
    }
    
    /* Summary section mobile - Hidden */
    #summary-section {
        margin: 1rem 0.5rem;
        padding: 1rem;
        display: none !important;
    }
    
    .summary-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .summary-number {
        font-size: 1.5rem;
    }
    
    .summary-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    /* Ultra-mobile optimizations */
    .responsive-table-container {
        margin: 0.5rem 0.25rem;
        padding: 0.75rem;
    }
    
    .table-title {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .data-card {
        padding: 0.75rem;
    }
    
    .card-label {
        font-size: 0.8rem;
    }
    
    .card-value {
        font-size: 0.875rem;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-nav-item {
        font-size: 0.7rem;
        min-width: 50px;
    }
    
    .mobile-nav-item i {
        font-size: 1rem;
    }
    
    /* Ultra-mobile footer legends */
    .footer-legend .legend-bar.horizontal {
        width: 100px;
        height: 4px;
    }
    
    .footer-legend .legend-labels.horizontal {
        width: 100px;
        font-size: 7px;
        height: 8px;
    }
    
    .footer-legend .legend-labels.horizontal .legend-label-low,
    .footer-legend .legend-labels.horizontal .legend-label-mid,
    .footer-legend .legend-labels.horizontal .legend-label-high {
        font-size: 7px;
    }
    
    .footer-legend .legend-title {
        font-size: 6px;
        margin-bottom: 0px;
    }
}

/* Dark mode support for mobile tables */
@media (prefers-color-scheme: dark) {
    .responsive-table-container {
        background: #1f2937;
        border-color: #374151;
    }
    
    .table-title {
        color: #f9fafb;
        border-color: #374151;
    }
    
    .responsive-table th {
        background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
        color: #f9fafb;
        border-color: #4b5563;
    }
    
    .responsive-table td {
        color: #e5e7eb;
        border-color: #374151;
    }
    
    .responsive-table tr:hover {
        background-color: #374151;
    }
    
    .data-card {
        background: #374151;
        border-color: #4b5563;
    }
    
    .card-label {
        color: #9ca3af;
    }
    
    .card-value {
        color: #f3f4f6;
    }
}

/* Print styles for tables */
@media print {
    .mobile-nav,
    .table-loading,
    .table-error,
    .empty-state {
        display: none;
    }
    
    .responsive-table-container {
        box-shadow: none;
        border: 1px solid #000;
        margin: 1rem 0;
    }
    
    .card-view {
        display: none;
    }
    
    .responsive-table {
        display: table;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .data-card,
    .mobile-nav-item,
    button,
    .btn,
    select,
    input {
        transition: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .responsive-table-container {
        border: 2px solid;
    }
    
    .responsive-table th,
    .responsive-table td {
        border: 1px solid;
    }
    
    .data-card {
        border: 2px solid;
    }
}

/* Update existing table views helper function */
.updateTableViews {
    /* This class helps JavaScript identify when to update table display modes */
}

/* Heatmap Legend Styles */
.heatmap-legend {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: Arial, sans-serif;
    z-index: 10;
}

/* Enhanced styling for motion heatmap legends */
.heatmap-legend.motion-legend {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
    width: auto;
    height: auto;
    z-index: 15;
}

/* Right-side legends */
.heatmap-legend.right-side {
    top: 50%;
    right: -70px;
    transform: translateY(-50%);
}

/* Left-side legends */
.heatmap-legend.left-side {
    top: 50%;
    left: -70px;
    transform: translateY(-50%);
}

/* Horizontal legends for motion heatmaps */
.heatmap-legend.horizontal {
    position: static;
    margin: 10px auto 0;
    width: fit-content;
}



.legend-title {
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 6px;
    color: #333;
}

/* Enhanced legend title for motion heatmaps */
.motion-legend .legend-title {
    font-size: 11px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 6px 0;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1;
    text-align: center;
}

/* Vertical legend container */
.legend-bar-container {
    display: flex;
    align-items: stretch;
}

/* Horizontal legend container */
.legend-bar-container.horizontal {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}



/* Vertical legend bar */
.legend-bar {
    width: 20px;
    height: 120px;
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

/* Horizontal legend bar */
.legend-bar.horizontal {
    width: 200px;
    height: 15px;
    margin-bottom: 4px;
}

/* Enhanced vertical legend bar for motion heatmaps */
.motion-legend .legend-bar {
    width: 20px;
    height: 100px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    margin: 0;
}

/* Vertical legend labels */
.legend-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 6px;
    height: 120px;
}

/* Horizontal legend labels */
.legend-labels.horizontal {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 200px;
    margin-left: 0;
    margin-top: 2px;
}

/* Enhanced vertical legend labels for motion heatmaps */
.motion-legend .legend-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 6px;
    height: 100px;
}

.legend-label-high,
.legend-label-mid,
.legend-label-low {
    font-size: 10px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

/* Enhanced legend labels for motion heatmaps */
.motion-legend .legend-label-high,
.motion-legend .legend-label-mid,
.motion-legend .legend-label-low {
    font-size: 10px;
    font-weight: 500;
    color: #374151;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1;
    margin: 0;
    padding: 0;
}

/* Position labels correctly for vertical layout */
.motion-legend .legend-label-high {
    margin-top: -2px;
}

.motion-legend .legend-label-low {
    margin-bottom: -2px;
}

.motion-legend .legend-label-mid {
    margin: auto 0;
}

/* Vertical legend label positioning */
.legend-labels:not(.horizontal) .legend-label-high {
    margin-top: -2px;
}

.legend-labels:not(.horizontal) .legend-label-low {
    margin-bottom: -2px;
}

.legend-labels:not(.horizontal) .legend-label-mid {
    margin: auto 0;
}

/* Horizontal legend label positioning */
.legend-labels.horizontal .legend-label-low {
    text-align: left;
}

.legend-labels.horizontal .legend-label-mid {
    text-align: center;
}

.legend-labels.horizontal .legend-label-high {
    text-align: right;
}

/* Enhanced horizontal legend label positioning for motion heatmaps */
.motion-legend .legend-labels.horizontal .legend-label-low {
    text-align: left;
    padding-left: 2px;
}

.motion-legend .legend-labels.horizontal .legend-label-mid {
    text-align: center;
    font-weight: 500;
}

.motion-legend .legend-labels.horizontal .legend-label-high {
    text-align: right;
    padding-right: 2px;
}

/* Mobile responsive legend */
@media (max-width: 768px) {
    /* All legends become static positioned on mobile */
    .heatmap-legend.left-side,
    .heatmap-legend.right-side {
        position: static;
        margin: 10px auto 0;
        left: auto;
        right: auto;
        transform: none;
        display: block;
        width: fit-content;
    }
    
    .heatmap-legend.horizontal {
        margin: 8px auto 0;
    }
    
    /* Enhanced motion legends on mobile */
    .heatmap-legend.motion-legend {
        position: static;
        margin: 10px auto 0;
        left: auto;
        right: auto;
        display: block;
        width: fit-content;
    }
    
    .motion-legend .legend-title {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    /* Vertical legends on mobile */
    .legend-bar:not(.horizontal) {
        width: 15px;
        height: 80px;
    }
    
    .legend-labels:not(.horizontal) {
        height: 80px;
        margin-left: 4px;
    }
    
    /* Horizontal legends on mobile */
    .legend-bar.horizontal {
        width: 150px;
        height: 12px;
    }
    
    .legend-labels.horizontal {
        width: 150px;
        margin-top: 2px;
    }
    
    /* Enhanced motion legend bars on mobile */
    .motion-legend .legend-bar {
        width: 15px;
        height: 80px;
    }
    
    .motion-legend .legend-labels {
        height: 80px;
        margin-left: 4px;
    }
    
    .legend-title {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .legend-label-high,
    .legend-label-mid,
    .legend-label-low {
        font-size: 9px;
    }
    
    /* Enhanced motion legend labels on mobile */
    .motion-legend .legend-label-high,
    .motion-legend .legend-label-mid,
    .motion-legend .legend-label-low {
        font-size: 11px;
    }
}

/* Pagination Styles for Tables */
.pagination-container {
    text-align: center;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.view-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.view-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.view-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.view-more-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3), 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Show Less button specific styling */
.show-less-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

.show-less-btn:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4) !important;
}

.show-less-btn:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3), 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

/* Cards pagination specific styling */
.cards-pagination {
    margin-top: 1.5rem;
    padding: 1.5rem;
}

/* Mobile responsive pagination */
@media (max-width: 768px) {
    .pagination-container {
        margin-top: 0.75rem;
        padding: 0.75rem;
    }
    
    .view-more-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .cards-pagination {
        margin-top: 1rem;
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .pagination-container {
        margin-top: 0.5rem;
        padding: 0.5rem;
    }
    
    .view-more-btn {
        padding: 8px 16px;
        font-size: 12px;
        width: 100%;
        max-width: 200px;
    }
}

/* Dark mode support for pagination */
@media (prefers-color-scheme: dark) {
    .pagination-container {
        background: rgba(30, 41, 59, 0.8);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .view-more-btn {
        border: 2px solid #000;
        background: #fff;
        color: #000;
    }
    
    .view-more-btn:hover {
        background: #000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .view-more-btn {
        transition: none;
    }
    
    .view-more-btn:hover {
        transform: none;
    }
}

