/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --text-color: #e0e0e0;
    --link-color: #4a90e2;
    --link-hover: #6bb6ff;
    --border-color: #2a2a3e;
    --max-width: 1200px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--primary-color);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(15, 52, 96, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(15, 52, 96, 0.15) 0%, transparent 50%);
    min-height: 100vh;
}

/* Header */
header {
    background-color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
}

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

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

nav a:hover,
nav a.active {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

/* Main Content */
main {
    max-width: var(--max-width);
    margin: 3rem auto;
    padding: 0 2rem;
}

.content-section {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--link-hover);
    border-bottom: 3px solid var(--accent-color);
    padding-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    margin: 2rem 0 1rem;
    color: var(--link-color);
}

h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--text-color);
}

h4 {
    font-size: 1.25rem;
    margin: 1.25rem 0 0.75rem;
    color: var(--text-color);
}

p {
    margin-bottom: 1.25rem;
    text-align: justify;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Lists */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1.25rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

.screenshot {
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.centered-image {
    display: block;
    margin: 2rem auto;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background-color: var(--accent-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.feature-card h3 {
    color: var(--link-hover);
    margin-top: 0;
}

/* Warning Box */
.warning-box {
    background-color: rgba(255, 152, 0, 0.1);
    border-left: 4px solid #ff9800;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.warning-box h3 {
    color: #ff9800;
    margin-top: 0;
}

/* Info Box */
.info-box {
    background-color: rgba(74, 144, 226, 0.1);
    border-left: 4px solid var(--link-color);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.info-box h3 {
    color: var(--link-color);
    margin-top: 0;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    border-top: 2px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--link-hover);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .content-section {
        padding: 1.5rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--link-color);
    color: white;
    padding: 20px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* 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: 20px!important; /* 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 */
}
