/* Enhanced button styling for better touch targets */
.btn-lg {
    font-size: 1.5rem;
    min-height: 64px;
    padding: 1.25rem 1.75rem;
    transition: transform 0.2s ease-in-out;
}

.btn-lg:hover {
    transform: scale(1.02);
}

.btn-lg i {
    font-size: 1.8rem;
    vertical-align: middle;
}

/* Improve regular button touch targets */
.btn {
    min-height: 44px;
    transition: all 0.2s ease-in-out;
}

.btn-sm {
    min-height: 36px;
}

/* Check item background */
.bg-light-success {
    background-color: rgba(25, 135, 84, 0.05);
}

/* Responsive tables */
@media (max-width: 767.98px) {
    .table-responsive-sm {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Prevent horizontal overflow and ensure full height */
html, body {
    overflow-x: hidden;
    max-width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

/* PWA Status Bar Integration */
@supports (-webkit-appearance: none) {
    /* iOS PWA full-screen mode */
    body {
        /* Extend background to cover status bar area */
        background: linear-gradient(to bottom, #2C3E50 0, #2C3E50 env(safe-area-inset-top, 0), #ffffff env(safe-area-inset-top, 0));
        padding-top: env(safe-area-inset-top, 0);
    }
    
    .navbar {
        /* Remove top padding since body now handles it */
        padding-top: 0;
        /* Extend navbar background into status bar area */
        margin-top: calc(-1 * env(safe-area-inset-top, 0));
        padding-top: calc(0.5rem + env(safe-area-inset-top, 0));
    }
}

body {
    display: flex;
    flex-direction: column;
}

.navbar {
    flex-shrink: 0;
}

/* Main content container */
body > .container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Navbar container uses Bootstrap defaults */
.navbar .container {
    max-width: 100%;
}

/* Ensure all rows don't create horizontal overflow */
.row {
    margin-left: 0;
    margin-right: 0;
}

.row > * {
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
}

/* Ensure form elements don't exceed container width */
.form-control, .form-select {
    max-width: 100%;
    box-sizing: border-box;
}

/* Prevent any element from causing horizontal overflow */
* {
    box-sizing: border-box;
}

.input-group {
    max-width: 100%;
}

/* Ensure cards don't exceed container width */
.card {
    max-width: 100%;
}

/* Form enhancement styles */
.card-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.card-header h5 {
    font-weight: 600;
}

.form-label.fw-bold {
    color: #495057;
    margin-bottom: 0.5rem;
}

.card {
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* Enhanced button styling for percentage options */
.btn-group .btn {
    transition: all 0.2s ease-in-out;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
}

/* Alert styling for Dani's share calculation */
.alert-info {
    border-left: 4px solid #0dcaf0;
    background-color: rgba(13, 202, 240, 0.1);
}

/* Improved image display */
.img-fluid.border.rounded.shadow-sm {
    transition: transform 0.2s ease-in-out;
}

.img-fluid.border.rounded.shadow-sm:hover {
    transform: scale(1.05);
    cursor: pointer;
}

/* Enhanced expense card styling */
.expense-card {
    transition: all 0.2s ease-in-out;
    border-left: 3px solid transparent;
    padding: 0.875rem 1rem !important;
}

.expense-card:hover {
    background-color: rgba(0, 123, 255, 0.03);
    border-left-color: #007bff;
}

.expense-card.bg-light-success:hover {
    background-color: rgba(25, 135, 84, 0.08);
    border-left-color: #198754;
}

/* Dropdown menu improvements */
.dropdown-menu {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    transition: background-color 0.15s ease-in-out;
}

.dropdown-item:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* Icon styling for expense types */
.expense-card .fas.fa-receipt,
.expense-card .fas.fa-money-check {
    font-size: 0.875rem;
}

/* Touch-optimized interface improvements */
@media (max-width: 767.98px) {
    /* Larger touch targets for buttons */
    .btn {
        min-height: 48px;
        padding: 0.75rem 1.25rem;
        font-size: 1.1rem;
    }
    
    .btn-sm {
        min-height: 40px;
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .btn-lg {
        min-height: 56px;
        padding: 1rem 1.5rem;
        font-size: 1.3rem;
    }
    
    /* Enhanced navbar toggle button */
    .navbar-toggler {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem;
    }
    
    /* Improve nav links for touch */
    .navbar-nav .nav-link {
        padding: 1rem 1.25rem;
        font-size: 1.1rem;
    }
    
    /* Enhanced dropdown menu items */
    .dropdown-item {
        padding: 0.75rem 1.25rem;
        font-size: 1.1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Form controls with better touch targets */
    .form-control,
    .form-select {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
    }
    
    /* Enhanced close buttons */
    .btn-close {
        min-height: 48px;
        min-width: 48px;
        padding: 1rem;
    }
    
    /* Better spacing for mobile interactions */
    .gap-2 {
        gap: 1rem !important;
    }
    
    .gap-3 {
        gap: 1.25rem !important;
    }
    
    /* Enhanced form styling for mobile */
    .form-label {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .input-group-text {
        min-height: 48px;
        padding: 0.75rem 1rem;
        font-size: 1.1rem;
    }
    
    /* Better card styling on mobile */
    .card {
        margin-bottom: 1.5rem;
    }
    
    .card-header {
        padding: 1rem 1.25rem;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    /* Radio button and checkbox improvements */
    .form-check {
        margin-bottom: 1rem;
    }
    
    .form-check-input {
        min-height: 20px;
        min-width: 20px;
        margin-top: 0.125rem;
    }
    
    .form-check-label {
        font-size: 1.1rem;
        padding-left: 0.5rem;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    /* Enhanced file input */
    .form-control[type="file"] {
        padding: 0.75rem 1rem;
        border: 2px dashed #dee2e6;
        background-color: #f8f9fa;
    }
    
    .form-control[type="file"]:focus {
        border-color: #0d6efd;
        background-color: #fff;
    }
    
    /* Multi-select improvements */
    select[multiple] {
        min-height: 120px;
    }
    
    select[multiple] option {
        padding: 0.5rem;
        font-size: 1rem;
    }
}

/* Mobile responsive adjustments for expense cards */
@media (max-width: 767.98px) {
    .expense-card {
        padding: 1.25rem !important;
    }
    
    /* Stack layout vertically on mobile */
    .expense-card .d-flex.justify-content-between {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    /* Make amount and actions row on mobile */
    .expense-card .d-flex.align-items-center.gap-3 {
        width: 100%;
        justify-content: space-between;
        gap: 1.25rem !important;
    }
    
    /* Adjust text alignment on mobile */
    .expense-card .text-end {
        text-align: left !important;
    }
    
    /* Improve touch targets on mobile */
    .expense-card .dropdown .btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.75rem;
    }
    
    /* Enhanced card header touch area */
    .card-header h5 {
        padding: 0.5rem 0;
        font-size: 1.2rem;
    }
    
    /* Better spacing for expense info */
    .expense-card h6 {
        font-size: 1.1rem;
    }
    
    .expense-card .fw-bold {
        font-size: 1.2rem;
    }
    
    /* Improved icon sizes for touch */
    .expense-card .fas {
        font-size: 1.1rem;
    }
} 