/* Responsive adjustments for appeal, recall, restoration, review, caveat forms */
@media (max-width: 767px) {
    /* Title and back button container */
    .position-relative.text-center.mb-4 {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .btn-back {
        position: static !important;
        transform: none !important;
        width: 100%;
        text-align: center;
    }
    
    /* Appellant and Respondent items negative margins adjustment */
    .appellant-item > div:first-child,
    .respondent-item > div:first-child {
        margin: -16px -16px 15px -16px !important;
        border-radius: 6px 6px 0 0 !important;
    }
    
    .appellant-item, .respondent-item {
        padding: 16px !important;
    }

    /* Remove absolute positioning of remove buttons on mobile */
    .remove-appellant, .remove-respondent {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        width: 100%;
        margin-top: 10px;
    }

    /* Annexure items layout */
    .annexure-item {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: stretch !important;
    }
    .annexure-item .col-md-6,
    .annexure-item .col-md-5,
    .annexure-item .col-md-1 {
        width: 100% !important;
    }
    .annexure-item .btn-danger {
        width: 100%;
        margin-top: 5px;
    }

    /* Submit button */
    #submitBtn {
        width: 100%;
    }

    /* Add more buttons */
    #addMoreAppellants, #addMoreRespondents, #addMoreAnnexures {
        width: 100%;
        margin-bottom: 10px;
    }

    /* Make all form labels more readable on mobile */
    .form-label {
        font-size: 14px;
        margin-bottom: 4px;
    }

    /* Adjust the form container padding */
    form.border.p-4 {
        padding: 15px !important;
    }

    /* Section titles margin */
    h4.alert.alert-warning {
        font-size: 16px;
        padding: 10px;
        word-wrap: break-word;
    }
    
    input.form-control, select.form-select, textarea.form-control {
        font-size: 14px;
    }

    /* --- Case Status / Cause List Mobile Styles --- */
    
    /* Make search card full width without margins */
    .search-card {
        margin: 10px 0 !important;
        border-radius: 0 !important;
    }
    
    /* Ensure buttons inside search card take full width */
    .search-form-content .btn, 
    #col-btn-case_no .btn,
    #col-btn-appellant .btn,
    #col-btn-respondent .btn,
    #col-btn-advocate .btn {
        width: 100% !important;
        margin-top: 10px !important;
    }
    
    /* Adjust accordion headers for mobile */
    .accordion-button {
        padding: 15px !important;
        font-size: 0.9rem !important;
    }
    
    /* Adjust results header */
    .results-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .results-header .d-flex.gap-2 {
        width: 100%;
        flex-direction: column;
    }
    
    .results-header .back-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Make table text smaller for mobile */
    .table td, .table th {
        font-size: 11px !important;
        padding: 8px 5px !important;
    }
    
    /* Section body padding for lists */
    .section-body {
        padding: 0 !important;
    }
    
    /* Modal adjustments */
    .modal-dialog {
        margin: 10px !important;
    }
    .modal-content {
        border-radius: 10px !important;
    }

    /* Fix section header overlap (Title vs Count) on mobile */
    .section-header .d-flex.w-100.position-relative {
        justify-content: space-between !important;
    }
    .section-header .position-absolute.start-50 {
        position: relative !important;
        left: auto !important;
        transform: none !important;
    }
    .section-header h6 {
        font-size: 1.1rem !important;
        white-space: normal;
        word-break: break-word;
    }
    .section-header .position-absolute.start-50 span {
        font-size: 1.5rem !important;
    }

    /* --- How to Appeal Page Styles --- */
    .nav-pills .nav-link {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
        margin: 4px !important;
    }
    .instruction-header, .checklist-header {
        padding: 15px 20px !important;
        font-size: 1.05rem !important;
    }
    .instruction-body, .checklist-body {
        padding: 15px !important;
    }
    .step-list li {
        padding-left: 65px !important;
    }
    .step-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.1rem !important;
    }
    .step-list::before {
        left: 23px !important;
    }
    .checklist-list li {
        padding: 12px 12px 12px 40px !important;
        font-size: 0.9rem !important;
    }
    .checklist-icon {
        left: 8px !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 0.75rem !important;
    }
    .custom-danger-alert {
        padding: 15px !important;
    }
}
