/* Mobile fixes for custom pages and footer */

/* Custom pages container */
.container {
    position: relative !important;
    z-index: 1 !important;
    min-height: calc(100vh - 40px) !important;
    margin-bottom: 40px !important;
    flex: 1 0 auto !important; /* Ensure container takes available space */
}

/* Main content area */
.main-content {
    position: relative !important;
    z-index: 1 !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    overflow: visible !important;
    height: auto !important; /* Allow content to determine height */
    min-height: 0 !important; /* Remove minimum height constraints */
}

/* Content area */
.content {
    position: relative !important;
    z-index: 1 !important;
    height: auto !important; /* Allow content to determine height */
    overflow: visible !important;
}

/* Footer fixes */
.sovtaj-footer {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    margin-top: auto !important;
    flex-shrink: 0 !important; /* Prevent footer from shrinking */
}

/* Body layout */
body {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    .container {
        padding: 10px !important;
        margin-bottom: 20px !important;
    }

    .main-content {
        margin-bottom: 0 !important;
    }

    .content {
        padding: 15px !important;
    }

    /* Ensure footer stays at bottom on mobile */
    .sovtaj-footer {
        margin-top: 20px !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    body {
        min-height: -webkit-fill-available !important;
    }
    
    .sovtaj-footer {
        margin-bottom: env(safe-area-inset-bottom, 0) !important;
    }
}