/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c5f2d;
    --secondary-color: #97bc62;
    --dark-bg: #1a1a1a;
    --light-bg: #f5f5f5;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --accent-color: #4a9d4f;
    --hover-color: #3d8b42;
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: #ffffff;
    font-size: 16px;
}

/* Header and Navigation */
header {
    background-color: var(--dark-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--secondary-color);
    font-size: 1.5rem;
    font-weight: bold;
}

.logo img {
    border-radius: 8px;
}

/* Hamburger Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background-color: #ffffff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-menu li a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    display: block;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    color: var(--secondary-color);
    background-color: rgba(151, 188, 98, 0.1);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    position: relative;
    margin-bottom: 3rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.hero img {
    width: 100%;
    height: auto;
    display: block;
}

.hero-content {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(44, 95, 45, 0.95), rgba(151, 188, 98, 0.95));
    color: #ffffff;
}

.hero-content h1 {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    line-height: 1.3;
}

.lead {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-content .lead {
    color: rgba(255, 255, 255, 0.95);
}

/* Content Sections */
section {
    margin-bottom: 3rem;
}

article {
    background-color: #ffffff;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    line-height: 1.3;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--secondary-color);
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

h4 {
    font-size: 1.3rem;
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

h5 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

h6 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

p {
    margin-bottom: 1.5rem;
    text-align: justify;
    color: var(--text-dark);
}

/* Image Containers */
.image-container {
    margin: 2rem 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Links */
a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: var(--dark-bg);
    color: #ffffff;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-content p {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #ffffff;
}

/* Responsive Design - Comprehensive Breakpoints */

/* Large Desktops - 1440px+ */
@media (min-width: 1440px) {
    main {
        max-width: 1400px;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2.2rem;
    }
}

/* Tablets and Small Desktops - 1024px */
@media (max-width: 1024px) {
    nav {
        padding: 0 1.5rem;
    }

    main {
        padding: 1.5rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.4rem;
    }
}

/* Tablets and Mobile - 768px */
@media (max-width: 768px) {
    /* Show hamburger menu */
    .hamburger {
        display: flex;
    }

    /* Hide desktop menu */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--dark-bg);
        flex-direction: column;
        padding: 5rem 2rem 2rem 2rem;
        gap: 1rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        width: 100%;
        padding: 1rem;
        text-align: left;
        font-size: 1.1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Typography adjustments */
    .hero-content h1 {
        font-size: 1.8rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    h4 {
        font-size: 1.2rem;
    }

    /* Content padding */
    main {
        padding: 1rem;
    }

    nav {
        padding: 0 1rem;
    }

    .hero-content {
        padding: 1.5rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    /* Footer adjustments */
    .footer-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-content {
        padding: 0 1rem;
    }
}

/* Small Mobile - 480px */
@media (max-width: 480px) {
    /* Navigation */
    .nav-menu {
        width: 100%;
        right: -100%;
    }

    /* Logo optimization */
    .logo {
        font-size: 1.2rem;
    }

    .logo img {
        width: 45px;
        height: 45px;
    }

    /* Typography for small screens */
    .hero-content h1 {
        font-size: 1.4rem;
        line-height: 1.4;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    h4 {
        font-size: 1.1rem;
    }

    /* Content adjustments */
    main {
        padding: 0.75rem;
    }

    .hero-content {
        padding: 1rem;
    }

    .lead {
        font-size: 1rem;
    }

    p {
        font-size: 0.95rem;
        text-align: left;
    }

    /* Input fields optimization */
    .portal-link-input {
        font-size: 18px;
        padding: 12px;
    }

    /* Touch-friendly buttons */
    .nav-menu li a {
        min-height: 48px;
        font-size: 1rem;
    }
}

/* Mobile Menu Overlay */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Accessibility */
:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    header,
    footer {
        display: none;
    }

    main {
        max-width: 100%;
    }

    a {
        text-decoration: underline;
    }
}

/* Ensure the parent container allows its children to size correctly */
.access-portal {
    /* If it's a flex container, ensure it allows children to take full width */
    display: block; /* Or flex, but ensure width: 100% is effective */
    width: 100%; /* Ensure the container itself takes full available width */
    max-width: 100%; /* Prevent it from expanding beyond its parent */
    overflow: hidden; /* Important: Prevents children from breaking out of this container */
    padding: 1rem 0; /* Example padding, adjust as needed */
}

.portal-link-input {
    display: block; /* Make it a block-level element */
    width: 100%; /* Crucial: Make the input take 100% of its parent's width */
    box-sizing: border-box; /* Include padding and border in the element's total width */
    padding: 10px; /* Adjust padding as needed for visual comfort */
    border: 1px solid var(--border-color); /* Use your defined border color */
    border-radius: 5px; /* Slightly rounded corners for aesthetics */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Inherit font for consistency */
    font-size: 16px; /* Consistent font size */
    color: var(--text-dark); /* Consistent text color */
    background-color: var(--light-bg); /* Consistent background */

    /* These are key for handling long text without breaking layout */
    white-space: nowrap; /* Keep text on a single line */
    overflow-x: auto; /* Add horizontal scrollbar if content overflows */
    -webkit-overflow-scrolling: touch; /* Improves scrolling on iOS devices */
    min-width: 0; /* Allows the input to shrink if necessary within flex/grid contexts */
}

/* Optional: Adjust other elements to ensure they don't push the layout */
.portal-title,
.portal-status,
p {
    max-width: 100%; /* Ensure these elements don't cause horizontal overflow */
    word-break: break-word; /* Break long words if necessary */
    margin-bottom: 0.5rem; /* Add some spacing */
}

/* Portal Link Container with Copy Button */
.portal-link-container {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

.copy-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(74, 157, 79, 0.3);
}

.copy-button:hover {
    background: linear-gradient(135deg, var(--hover-color), var(--primary-color));
    box-shadow: 0 4px 12px rgba(74, 157, 79, 0.4);
    transform: translateY(-1px);
}

.copy-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 157, 79, 0.3);
}

.copy-button.copied {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.copy-icon {
    font-size: 18px;
    line-height: 1;
}

.copy-text {
    font-size: 14px;
    font-weight: 600;
}

/* Mobile adjustments for copy button */
@media (max-width: 480px) {
    .portal-link-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .copy-button {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }

    .portal-link-input {
        font-size: 14px;
    }
}
