/*------------------------------------------------------------------
    File Name: resources-responsive.css
    Custom Responsive Fixes for Password-Protected Resources Page
-------------------------------------------------------------------*/

/* Main wrapper spacing for pages missing the header */
.resources-page-wrapper, 
body:not(.clinic_version) .section, 
.auth-container, 
.resources-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 15px;
    margin: 0 auto;
}

/* Ensure containers and rows conform neatly on mobile */
@media (max-width: 992px) {
    .resources-page-wrapper .container,
    .resources-content .container {
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Fix form inputs or password prompt boxes if overflowing */
    form input[type="password"],
    form input[type="text"],
    form button,
    .btn {
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
    }
}

/* Tablet and mobile adjustment (768px and down) */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .first-section, 
    .section {
        padding: 4em 0 3em !important;
    }

    /* Force tables or resource lists to scroll horizontally rather than breaking layout */
    table, .table-responsive {
        width: 100%;
        overflow-x: auto;
        display: block;
    }

    /* Adjust typography scaling for smaller screens */
    h1 { font-size: 28px !important; }
    h2 { font-size: 24px !important; }
    h3 { font-size: 20px !important; }
}

/* Small mobile devices (600px and down) */
@media (max-width: 600px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Stack any floated resource elements */
    .box1 a, .box2 a {
        float: none !important;
        width: 100% !important;
        margin: 10px auto !important;
    }
}



/* Pushes main body content down below the fixed header */
    .resource-wrapper {
        padding-top: 180px;
        padding-bottom: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative; /* Added to establish positioning context */
            /* Keep it below header layers if needed, but allow children to layer properly */
    }

    /* Style for the Login Card */
    .login-card {
        background: #ffffff;
        padding: 30px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        position: relative;
        z-index: 10;
    }

    .login-card h2 {
        margin-top: 0;
        margin-bottom: 20px;
        font-size: 22px;
        color: #333333;
        text-align: center;
    }

    .login-card input[type="password"] {
        width: 100%;
        padding: 12px;
        margin-bottom: 15px;
        border: 1px solid #cccccc;
        border-radius: 4px;
        box-sizing: border-box;
    }

    .login-card input[type="submit"] {
        width: 100%;
        padding: 12px;
        background-color: #007bff;
        border: none;
        color: white;
        font-weight: bold;
        border-radius: 4px;
        cursor: pointer;
    }

    .login-card input[type="submit"]:hover {
        background-color: #0056b3;
    }

    .login-card .error {
        color: #dc3545;
        font-size: 14px;
        margin-bottom: 15px;
        text-align: center;
    }

    /* Style for Protected Content Container with Sidebar Layout */
    .vault-container {
        width: 100%;
        max-width: 1000px;
        background: #ffffff;
        padding: 30px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        display: flex;
        flex-wrap: wrap;
        z-index: 11;         /* Keep it below header layers if needed, but allow children to layer properly */
    }

    .vault-header {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #eeeeee;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }

    .vault-header h1 {
        margin: 0;
        font-size: 24px;
        color: #333333;
    }

    .logout-btn {
        padding: 8px 16px;
        background: #6c757d;
        color: white;
        text-decoration: none;
        border-radius: 4px;
        position: relative;
        z-index: 1;
    }

    .logout-btn:hover {
        background: #5a6268;
        color: white;
        text-decoration: none;
    }

    /* Vertical Navigation Menu */
    .vault-sidebar {
        flex: 1;
        min-width: 200px;
        background: #f8f9fa;
        border-radius: 6px;
        padding: 15px;
        border: 1px solid #e9ecef;
    }

    .vault-sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .vault-sidebar ul li {
        margin-bottom: 8px;
    }

    .vault-sidebar ul li a {
        display: block;
        padding: 10px 15px;
        color: #495057;
        text-decoration: none;
        border-radius: 4px;
        font-weight: 500;
        transition: background 0.2s, color 0.2s;
    }

    .vault-sidebar ul li a:hover {
        background: #e2e6ea;
        color: #007bff;
        text-decoration: none;
    }

    .vault-sidebar ul li a.active-tab {
        background: #007bff;
        color: white;
    }

    /* Main Content Display Area for Pages */
    .vault-content {
        flex: 3;
        min-width: 300px;
        padding: 5px 15px;
    }

    .vault-content h3 {
        margin-top: 0;
        color: #333333;
    }