/* Mobile-first responsive styles for ClientPortal */

/* Upload Progress Overlay - Centered Modal */
.upload-progress-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 1400 !important;
    padding: 20px !important;
}

.upload-progress-panel {
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    width: 100% !important;
    max-width: 400px !important;
    max-height: 80vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.progress-header {
    background-color: rgb(21, 39, 59) !important;
    padding: 16px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.progress-content {
    padding: 20px !important;
    overflow-y: auto !important;
    max-height: calc(80vh - 60px) !important;
}

.progress-item {
    padding: 12px !important;
    background: #f5f5f5 !important;
    border-radius: 6px !important;
    margin-bottom: 12px !important;
}

.progress-item:last-child {
    margin-bottom: 0 !important;
}

.progress-item-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 8px !important;
    gap: 12px !important;
}

/* Global responsive fixes */
@media (max-width: 768px) {
    /* Upload progress panel mobile adjustments */
    .upload-progress-panel {
        max-width: calc(100vw - 32px) !important;
        margin: 16px !important;
        max-height: 70vh !important;
    }

    .progress-header {
        padding: 12px !important;
    }

    .progress-content {
        padding: 12px !important;
    }

    .progress-item-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    /* Prevent horizontal scrolling */
    body, html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Make MudBlazor containers responsive */
    .mud-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
        max-width: 100% !important;
    }

    .mud-grid {
        margin-left: -8px !important;
        margin-right: -8px !important;
    }

    .mud-grid-item {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Make drawer full width on mobile */
    .mud-drawer {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Make papers responsive */
    .mud-paper {
        overflow-x: hidden !important;
        max-width: 100% !important;
    }

    /* Adjust text sizes for mobile */
    .mud-typography-body1 {
        font-size: 0.9rem !important;
    }

    .mud-typography-body2 {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 576px) {
    /* Stack buttons in MudStack when in row mode on very small screens */
    .mud-stack-row {
        flex-direction: column !important;
    }

    /* Make buttons full width on mobile */
    .mud-button-root {
        width: 100% !important;
        white-space: normal !important;
        min-height: 36px !important;
    }

    /* Adjust file chip display */
    .mud-chip {
        max-width: 100% !important;
        font-size: 0.8rem !important;
    }

    .mud-chip-content {
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Adjust popover for mobile */
    .mud-popover-content {
        max-width: 90vw !important;
    }
}

/* Ensure images are always responsive */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Index page specific mobile styles */
@media (max-width: 768px) {
    .headercontact {
        position: static !important;
        padding: 15px 0px 0px 0px !important;
        text-align: center !important;
        height: auto !important;
        margin-left: 0 !important;
    }

    .logo {
        height: auto !important;
        padding: 10px 0 !important;
    }

    .Motley {
        width: 150px !important;
        height: 100px !important;
        background-size: contain !important;
        margin: 0 auto !important;
    }

    .headerphone {
        font-size: 1.1em !important;
        text-align: center !important;
        display: block !important;
    }

    .contact, .conect {
        width: 100% !important;
        padding: 10px !important;
        height: auto !important;
    }

    .copyright {
        width: 100% !important;
        float: none !important;
        text-align: center !important;
    }

    .footerLogo {
        float: none !important;
        margin: 20px auto 0 !important;
        display: block !important;
    }

    .rights {
        text-align: center !important;
    }

    .list {
        margin-right: 8px !important;
    }

    .motleyLinks {
        width: auto !important;
        margin-right: 10px !important;
    }

    .content .col-md-4 {
        margin-bottom: 20px !important;
    }
}

@media (max-width: 576px) {
    .headerphone {
        font-size: 1em !important;
    }

    .title {
        font-size: 18px !important;
    }

    .call {
        font-size: 20px !important;
        padding: 10px 0 !important;
    }

    .footerLogo {
        width: 150px !important;
        height: 60px !important;
    }
}

/* Ensure component background is responsive */
.Component {
    background-size: cover !important;
    background-position: center !important;
}

/* Prevent horizontal scrolling */
.row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
