:root {
    --primary-color: #0066CC; /* Vibrant Blue */
    --secondary-color: #003366; /* Deep Navy */
    --accent-color: #66B2FF; /* Sky Blue */
    --light-color: #E6F0FA; /* Soft Blue-Gray */
    --dark-color: #001A33; /* Midnight Blue */
    --text-color: #001A33; /* Midnight Blue */
    --text-light: #E6F0FA; /* Soft Blue-Gray */
    --shadow-sm: 0 4px 8px rgba(0, 51, 102, 0.1); /* Blue-tinted shadow */
    --shadow-md: 0 5px 15px rgba(0, 51, 102, 0.05);
    --shadow-lg: 0 8px 16px rgba(0, 51, 102, 0.2);
    --background: var(--light-color);
    --text: var(--text-color);
}

[data-theme="dark"] {
    --background: #1a2a44;
    --text: #e6f0fa;
    --primary-color: #4d99e6;
    --secondary-color: #2a5298;
    --light-color: #2a3b5a;
    --text-color: #e6f0fa;
    --shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.3);
}

html {
    scroll-behavior: smooth;
}

/* Prevent horizontal overflow */
html, body {
  overflow-x: hidden;
  width: 100%;
}

/* Ensure all elements respect the viewport */
* {
  box-sizing: border-box;
  max-width: 100%;
}


body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Wave Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(40, 167, 69, 0.05), rgba(255, 255, 255, 0.1));
    animation: waveBackground 15s linear infinite;
    z-index: -1;
    opacity: 0.3;
}

.navbar {
    padding: 0px 0;
    background: rgba(0, 51, 102, 0.9); /* Deep Navy with transparency */
    position: sticky;
    top: 0;
    height: 85px;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease-in-out;
    backdrop-filter: blur(10px);
}

.navbar.scrolled {
    background: rgba(0, 51, 102, 0.95); /* Darker Deep Navy */
    padding: 0px 0;
    box-shadow: var(--shadow-lg);
}

.navbar .logo {
    margin-left: -45px;
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.navbar .logo i {
    margin-right: 6px;
    color: var(--accent-color);
}

.navbar .logo:hover {
    color: var(--text-light);
    transform: scale(1.05);
}

.navbar .nav-link {
    color: var(--text-light);
    font-weight: 500;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    margin: 0 5px;
    position: relative;
}

.navbar .nav-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    bottom: 0;
    left: 0;
    transition: width 0.3s;
}

.navbar .nav-link:hover:after {
    width: 100%;
}

.navbar .nav-link:hover {
    color: var(--text-light);
    background: rgba(102, 178, 255, 0.1); /* Sky Blue with transparency */
}

.navbar .nav-link.active {
    color: var(--accent-color);
    font-weight: 600;
}

.navbar .nav-link.active:after {
    width: 100%;
}

.navbar .nav-link.login {
    background: var(--primary-color);
    border-radius: 25px;
    padding: 10px 20px;
}

.navbar .nav-link.login:hover {
    background: var(--accent-color);
}

header {
    background: url('../homeimage1.jpg') center/cover no-repeat fixed;
    background-attachment: fixed;
    height: 100vh;
    color: var(--text-light);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    animation: fadeInUp 1s ease-out;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 26, 51, 0.3); /* Midnight Blue overlay */
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
    animation: slideIn 1.5s ease-out;
}

header h1 {
    font-size: 4rem;
    margin: 0;
    font-weight: 800;
    text-shadow: 2px 2px 5px rgba(0, 26, 51, 0.5); /* Midnight Blue shadow */
    margin-bottom: 20px;
}

header p {
    font-size: 1.7rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 26, 51, 0.5);
}

.cta-button {
    color: var(--text-light);
    display: inline-block;
    padding: 15px 30px;
    background-color: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    will-change: transform, box-shadow;
}

.cta-button:hover {
    background-color: transparent;
    color: var(--text-light);
    border-color: var(--text-light);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    overflow-x: hidden;
}

.section {
    background: var(--light-color);
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

h2 {
    color: var(--secondary-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 10px;
    font-weight: 700;
    margin-bottom: 25px;
    position: relative;
    text-align: center;
}

h2:after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: var(--accent-color);
}

.new-card {
    background: linear-gradient(145deg, #ffffff, #f5f7fa);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 51, 102, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    border: 1px solid rgba(0, 102, 204, 0.1);
}

.new-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 51, 102, 0.2);
}

.new-card-img-top {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.new-card:hover .new-card-img-top {
    transform: scale(1.05);
}

.new-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0 0 15px 15px;
}

.new-card-title {
    color: var(--secondary-color);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    line-height: 1.3;
    text-transform: capitalize;
}

.new-card-text {
    color: #444;
    font-size: 1rem;
    margin-bottom: 15px;
    flex-grow: 1;
    line-height: 1.5;
    font-weight: 400;
}

.new-btn {
    align-self: flex-end;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.2);
    position: relative;
    overflow: hidden;
}

.new-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.new-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.3);
}

.btn:not(.new-btn) {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 50px;
    margin: 10px 5px;
    transition: all 0.3s;
    font-weight: 500;
    border: 2px solid transparent;
}

.btn:not(.new-btn):hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-md);
    color: var(--text-color);
    background-color: var(--light-color);
}

.story-card {
    display: flex;
    background: var(--light-color);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s, box-shadow 0.3s;
    margin: 20px auto;
    max-width: 900px;
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.story-image {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.story-card:hover .story-image img {
    transform: scale(1.1);
}

.story-content {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.story-title {
    color: var(--secondary-color);
    font-size: 1.8rem;
    margin-bottom: 15px;
    font-weight: 700;
}

.story-content .blockquote {
    font-size: 1.1rem;
    color: var(--text-color);
    border-left: 5px solid var(--accent-color);
    padding-left: 20px;
    margin-bottom: 20px;
}

.story-content .btn {
    align-self: flex-start;
}

.post-meta {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.cta-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--text-light);
    text-align: center;
    padding: 40px 20px;
    border-radius: 10px;
    animation: pulse 2s infinite;
}

.cta-banner h2 {
    color: var(--text-light);
    border-bottom: 3px solid var(--text-light);
}

.cta-banner h2:after {
    background: var(--text-light);
}

.cta-banner .newsletter-form input {
    border-radius: 5px;
    border: 1px solid var(--text-light);
    padding: 10px;
}

.cta-banner .newsletter-form input:focus {
    border-color: var(--text-light);
    box-shadow: 0 0 0 2px rgba(102, 178, 255, 0.2); /* Sky Blue shadow */
}

.cta-banner .newsletter-form .btn {
    padding: 10px 20px;
}

footer {
    background: var(--secondary-color);
    color: var(--text-light);
    padding: 50px 0 20px;
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-column h3 {
    color: var(--text-light);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #A3C6FF; /* Lighter blue for readability */
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--text-light);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(102, 178, 255, 0.1); /* Sky Blue with transparency */
    border-radius: 50%;
    color: var(--text-light);
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(102, 178, 255, 0.1); /* Sky Blue border */
}

a:focus, button:focus, input:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes waveBackground {
    0% { transform: translateX(0); }
    100% { transform: translateX(-1000px); }
}

@keyframes changeImage {
    0% {
        background-image: url("https://wallpapers.com/images/featured/4k-nature-ztbad1qj8vdjqe0p.jpg");
        opacity: 1;
    }
    16% {
        opacity: 1;
    }
    20% {
        background-image: url("https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/4bdd888b-fe5c-4358-8c46-5362c7ce3154/deg01bj-f17a901f-89bf-4a43-80cb-54efce914b02.jpg/v1/fill/w_1192,h_670,q_70,strp/4k_beautiful_nature_by_skullbreaker000_deg01bj-pre.jpg?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7ImhlaWdodCI6Ijw9NzIwIiwicGF0aCI6IlwvZlwvNGJkZDg4OGItZmU1Yy00MzU4LThjNDYtNTM2MmM3Y2UzMTU0XC9kZWcwMWJqLWYxN2E5MDFmLTg5YmYtNGE0My04MGNiLTU0ZWZjZTkxNGIwMi5qcGciLCJ3aWR0aCI6Ijw9MTI4MCJ9XV0sImF1ZCI6WyJ1cm46c2VydmljZTppbWFnZS5vcGVyYXRpb25zIl19.Mm1T06sYpOVfeVo-uA_2tohVCYEsxYygsqKeiSx1oCU");
        opacity: 1;
    }
    36% {
        opacity: 1;
    }
    40% {
        background-image: url("https://wallpapercave.com/wp/wp5918136.jpg");
        opacity: 1;
    }
    56% {
        opacity: 1;
    }
    60% {
        background-image: url("https://wallpapercave.com/wp/wp9203601.jpg");
        opacity: 1;
    }
    76% {
        opacity: 1;
    }
    80% {
        background-image: url("https://dm0qx8t0i9gc9.cloudfront.net/thumbnails/video/GTYSdDW/aerial-footage-from-beautiful-nature-norway-shot-in-4k-ultra-high-definition-uhd_nyg1zh8xg_thumbnail-1080_01.png");
        opacity: 1;
    }
    96% {
        opacity: 1;
    }
    100% {
        background-image: url("https://wallpapers.com/images/featured/4k-nature-ztbad1qj8vdjqe0p.jpg");
        opacity: 1;
    }
}

.animated-bg {
    animation: changeImage 50s infinite;
}

@media (max-width: 992px) {
    header h1 {
        font-size: 3.5rem;
    }
    header p {
        font-size: 1.5rem;
    }
    .story-card {
        flex-direction: column;
    }
    .story-image img {
        height: 250px;
    }
    .story-content {
        padding: 20px;
    }
    .story-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    header p {
        font-size: 1.2rem;
    }
    .story-image img {
        height: 200px;
    }
    .new-card-img-top {
        height: 180px;
    }

    /* Add background to navbar contents in mobile view */
    .navbar-collapse {
        background: rgba(55, 71, 79, 0.98);
        padding: 15px 10px 20px 10px;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    }
}

@media (max-width: 576px) {
    header h1 {
        font-size: 2rem;
    }
    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
    }
    .story-card {
        margin: 10px auto;
    }
    .story-title {
        font-size: 1.3rem;
    }
    .new-card-img-top {
        height: 150px;
    }
    .cta-banner .newsletter-form input {
        width: 150px;
    }
}