/* General Layout and Reset */
html {
    scroll-padding-top: 170px; /* Default: Accounts for main header (120px) + A-Z nav height (~50px) */
}

.ucfcr-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Margins for the main article content */
.ucfcr-country,
.ucfcr-archive {
    margin-top: 2rem;
    margin-bottom: 3rem;
}


/* Back Link (top) */
.back-link-top {
    margin-bottom: 1.5rem;
}
.back-link-top a {
    display: inline-block;
    padding: 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    text-decoration: underline;
    color: #005c8a; /* Use the blue for consistency */
    font-size: 0.95em;
    font-weight: normal;
    transition: color 0.2s ease;
}
.back-link-top a:hover {
    color: #004c6a; /* Darker blue on hover */
    background-color: transparent;
    border-color: transparent;
}

/* A-Z Navigation (for archive page, existing) */
.ucfcr-az-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 1rem 0;
    /* Sticky Navigation */
    position: sticky;
    top: 120px; /* Adjusted based on your top navigation height */
    z-index: 100; /* Ensure it stays above other content */
    background-color: #fff; /* White background when sticky */
    padding: 0.8rem 1rem; /* Added padding */
    border: 1px solid #e0e0e0; /* Subtle border */
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08); /* Subtle shadow */
    transition: top 0.3s ease; /* Smooth transition for sticky effect */
}
.az-btn {
    flex: 1 0 calc(100% / 13 - .4rem);
    text-align: center;
    padding: .3rem 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    margin-bottom: .4rem;
    color: #005c8a; /* Updated blue */
    transition: background-color 0.2s ease;
}
.az-btn:hover {
    background-color: #f0f0f0;
}
.az-btn.disabled {
    opacity: .3;
    pointer-events: none;
}
.ucfcr-letter-heading {
    margin-top: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: .2rem;
    margin-bottom: .5rem;
}
.ucfcr-country-list {
    list-style: none;
    padding-left: 0;
    columns: 2 200px; /* Responsive columns */
}
.ucfcr-country-list li {
    margin: .25rem 0;
}

/* Archive Intro Section */
.ucfcr-intro-section {
    margin-bottom: 2rem;
    padding: 1rem 0; /* Add some vertical padding */
    line-height: 1.6;
}
.ucfcr-intro-section p:last-child {
    margin-bottom: 0;
}

/* Requirement Sections & Items */
.ucfcr-requirements-list {
    margin-top: 2rem;
}
.ucfcr-requirements-section {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background-color: #f9f9f9;
}
.ucfcr-section-title {
    margin-top: 0;
    color: #2c3338;
    border-bottom: 1px dashed #d0d0d0;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.ucfcr-requirement-item {
    margin-bottom: 1.5rem;
    background-color: #fff;
    border: 1px solid #e9e9e9;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.ucfcr-requirement-title {
    font-size: 1.15em;
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #005c8a; /* Darker blue for titles */
    text-shadow: 0 1px 1px rgba(0,0,0,0.05); /* Subtle shadow for depth */
}
.ucfcr-requirement-title small {
    font-size: 0.8em;
    color: #666;
    margin-left: 0.5em;
}
.ucfcr-requirement-content {
    line-height: 1.6;
    margin-bottom: 0.8em;
}
.ucfcr-requirement-edit-link {
    text-align: right;
    margin-top: 0.5rem;
    margin-bottom: 0;
}
.ucfcr-requirement-edit-link a {
    display: inline-block;
    font-size: 0.85em;
    color: #a0a0a0;
    text-decoration: none;
    border-bottom: 1px dotted #a0a0a0;
}
.ucfcr-requirement-edit-link a:hover {
    color: #005c8a; /* Updated blue on hover */
    border-bottom-color: #005c8a;
}

/* Global Instructions Section */
.ucfcr-global-instructions {
    margin-top: 2rem;
    padding: 1.8rem; /* Slightly increased padding */
    background-color: #fcfcfc; /* Very light off-white/gray */
    border: 1px solid #e0e0e0; /* Softer, light gray border */
    border-radius: 5px;
    color: #333;
    line-height: 1.6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Subtle shadow */
}
.ucfcr-global-instructions p:last-child {
    margin-bottom: 0;
}


/* Admin Actions Panel */
.ucfcr-admin-actions {
    margin-top: 3rem;
    padding: 1.5rem;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background-color: #fefefe;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}
.ucfcr-admin-actions p {
    margin: 0;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

/* Admin Action Buttons */
.ucfcr-admin-actions .edit-country-btn,
.ucfcr-admin-actions .settings-btn {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

/* Edit Country Button */
.ucfcr-admin-actions .edit-country-btn {
    background-color: #005c8a; /* Darker blue */
    color: #fff;
    border: 1px solid #005c8a;
}
.ucfcr-admin-actions .edit-country-btn:hover {
    background-color: #004c6a; /* Even darker on hover */
    border-color: #004c6a;
}

/* Edit Settings Button */
.ucfcr-admin-actions .settings-btn {
    background-color: #f0f0f0;
    color: #555 !important; /* Added !important to override external styles */
    border: 1px solid #ccc;
}
.ucfcr-admin-actions .settings-btn:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
    color: #333;
}

/* Media Query for smaller screens: Adjust sticky navigation offset and scroll padding */
@media (max-width: 800px) {
    html {
        scroll-padding-top: 50px; /* Adjusts for only A-Z nav height on smaller screens */
    }
    .ucfcr-az-nav {
        top: 0; /* Pins directly to the top of the viewport */
        justify-content: flex-start; /* Align items to the left */
        gap: 5px; /* Add space between items */
    }
    .ucfcr-az-nav .az-btn {
        flex: 0 0 auto; /* Make buttons only take content width */
        padding: .3rem .5rem; /* Add horizontal padding for better button appearance */
    }
}