/* Layout: header, nav, footer, sidenav, sticky header, responsive */
#content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    transition: margin-left .5s;
}

header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header h1 {
    margin: 0;
    text-align: center;
    flex-grow: 1;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
}

/* Header Action Buttons Layout */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-link {
    color: var(--header-text);
    text-decoration: none;
    font-size: 1.5rem;
    margin-left: 1rem;
}

footer {
    background: var(--header-bg);
    color: var(--header-text);
    text-align: center;
    padding: 1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
}

nav a {
    color: var(--header-text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: background-color 0.3s ease;
}

nav a:hover {
    background: var(--button-hover-bg);
}

.sidenav {
    height: 100%;
    width: 0;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: #111;
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 60px;
}

.sidenav a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 25px;
    color: #818181;
    display: block;
    transition: 0.3s;
}

.sidenav a:hover {
    color: #f1f1f1;
}

.sidenav .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}

/* Project Page Styles */
.project-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow-color);
    max-width: 100%;
    margin: 0 auto 2rem auto;
    box-sizing: border-box;
}

.project-header.full-width {
    max-width: 100%;
    width: 100%;
    margin: 0 0 2rem 0;
}

.header-content {
    max-width: 100%;
    margin: 0 auto;
}

.header-text h1 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 2.25rem;
    font-weight: 600;
}

.header-text h2 {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 1.2rem;
}

/* Sticky Header Styles */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-color);
    box-shadow: 0 2px 8px var(--shadow-color);
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

[data-theme="dark"] .sticky-header {
    background: var(--bg-color);
    border-bottom-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.main-content-area {
    padding: 0 2rem 2rem 2rem;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.main-content-area.full-width {
    max-width: 100%;
    padding: 0 2rem 2rem 2rem;
    box-sizing: border-box;
}

.cards-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
    box-sizing: border-box;
}

.offer-details-card {
    flex: 2;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.resources-card {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.resource-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-link-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
}

.resource-link-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Page Title in Header */
.page-title {
    margin: 0;
    margin-left: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--header-text);
}

@media screen and (max-height: 450px) {
    .sidenav {padding-top: 15px;}
    .sidenav a {font-size: 18px;}
}

/* Responsive Design for Cards Row and Full Width Layout */
@media (max-width: 1024px) {
    .cards-row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .offer-details-card,
    .resources-card {
        flex: none;
    }
    
    .main-content-area.full-width {
        max-width: 100%;
        padding: 0 1.5rem 2rem 1.5rem;
    }
    
    .project-header.full-width {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .header-text {
        text-align: center;
    }
    
    .header-text h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .header-text h2 {
        font-size: 1rem;
        margin: 0;
    }
    
    .main-content-area,
    .main-content-area.full-width {
        max-width: 100%;
        padding: 0 1rem 1rem 1rem;
    }
    
    .project-header.full-width {
        max-width: 100%;
        padding: 1.5rem 1rem;
    }
    
    .cards-row {
        gap: 1rem;
    }
    
    .resource-links {
        gap: 0.75rem;
    }
    
    .resource-link-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-content-area,
    .main-content-area.full-width {
        max-width: 100%;
        padding: 0 0.75rem 1rem 0.75rem;
    }
    
    .project-header.full-width {
        max-width: 100%;
        padding: 1rem 0.75rem;
    }
}
