/* Escalada Cadence - Custom Styles */

body {
    font-family: 'Roboto', sans-serif;
}

/* Spacing utilities */
.mt-8 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Custom MudBlazor overrides */
.mud-table-dense .mud-table-cell {
    padding: 8px;
}

/* PWA / Mobile Optimization */

/* Safe area insets for notched devices */
@supports (padding: max(0px)) {
    .mud-layout {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
    .mud-button,
    .mud-icon-button,
    .mud-chip,
    .mud-nav-link,
    .mud-list-item {
        min-height: 44px;
        min-width: 44px;
    }

    .mud-checkbox,
    .mud-radio {
        padding: 12px;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 600px) {
    /* Reduce padding on mobile */
    .mud-paper.pa-4 {
        padding: 12px !important;
    }

    /* Stack buttons vertically on small screens */
    .mud-stack.flex-row-on-desktop {
        flex-direction: column !important;
    }

    /* Full width cards on mobile */
    .mud-card {
        margin-left: 0;
        margin-right: 0;
    }

    /* Better table scrolling */
    .mud-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Adjust nav drawer */
    .mud-drawer {
        width: 280px !important;
    }

    /* Hide less important columns on mobile */
    .hide-on-mobile {
        display: none !important;
    }

    /* Adjust page header */
    .page-header-title {
        font-size: 1.25rem !important;
    }

    /* Make dialogs full-width on mobile */
    .mud-dialog {
        margin: 8px;
        max-width: calc(100vw - 16px) !important;
    }

    /* Better form fields on mobile */
    .mud-input-control {
        margin-bottom: 8px;
    }
}

/* Tablet adjustments */
@media (min-width: 601px) and (max-width: 960px) {
    .mud-drawer {
        width: 240px !important;
    }
}

/* Dark mode support (respects system preference) */
@media (prefers-color-scheme: dark) {
    /* These will apply when MudBlazor dark theme is enabled */
    .mud-theme-dark .offline-container {
        background: #1e1e1e;
        color: #fff;
    }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* PWA Install banner support */
.pwa-install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1976d2;
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.pwa-install-prompt.hidden {
    display: none;
}

/* Pull-to-refresh indicator */
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: #1976d2;
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    transition: transform 0.3s ease;
    z-index: 9999;
}

.pull-to-refresh.visible {
    transform: translateX(-50%) translateY(0);
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #f44336;
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.visible {
    transform: translateY(0);
}

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

/* Better focus states for accessibility */
*:focus-visible {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}
