* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background: #FFFFFF;
    color: #1A3C5E;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.5s ease-in-out, color 0.5s ease-in-out;
}

body.dark-mode {
    background: #2C3E50;
    color: #ECF0F1;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1A3C5E;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ECF0F1;
    border-top: 5px solid #F5A623;
    border-radius: 50%;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 40px;
    background: rgba(26, 60, 94, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 900;
    transition: padding 0.3s ease-in-out, background 0.3s ease-in-out;
}

body.dark-mode .navbar {
    background: rgba(44, 62, 80, 0.9);
}

.nav-logo img {
    height: 50px;
    transition: transform 0.3s ease-in-out;
}

.nav-logo img:hover {
    transform: scale(1.1);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: #ECF0F1;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    transition: color 0.3s ease-in-out;
}

.nav-links a:hover {
    color: #F5A623;
}

.nav-toggle {
    display: none;
    font-size: 1.5em;
    color: #ECF0F1;
    cursor: pointer;
    transition: color 0.3s ease-in-out;
}

.nav-toggle:hover {
    color: #F5A623;
}

/* Portfolio Hero Section */
.portfolio-hero {
    position: relative;
    height: 70vh;  /* Slightly reduced for tighter spacing */
    padding-top: 80px;  /* Reduced to bring text closer to the navbar */
    background: url(./img/MAK\ Media\ BG\ Website.jpg) center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ECF0F1;
    margin-bottom: 20px;  /* Reduced bottom margin */
}

.portfolio-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 60, 94, 0.7);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8em;  /* Adjusted for better balance */
    margin-top: 0;  /* Ensure no extra margin */
    margin-bottom: 10px;  /* Adjusted margin */
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    padding-top: 20px;  /* Adjust padding for more spacing from the navbar */
}

.hero-content p {
    font-size: 1.2em;  /* Adjusted font size */
    padding: 0 20px;  /* Add padding to avoid text touching edges */
    margin-bottom: 15px; /* Reduced bottom margin */
}

/* Behance Projects Section */
.behance-projects {
    padding: 60px 20px;  /* Reduced padding */
    text-align: center;
    background: #F5F7FA;
    animation: slideUp 1s ease-in-out;
}

body.dark-mode .behance-projects {
    background: #34495E;
}

.behance-projects h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.3em;
    margin-top: 0;  /* Removed extra margin */
    margin-bottom: 10px;  /* Adjusted for better spacing */
    color: #1A3C5E;
}

body.dark-mode .behance-projects h2 {
    color: #F5A623;
}

.behance-projects p {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.2em;
}

.behance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.behance-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    transition: transform 0.3s ease-in-out;
}

.behance-item:hover {
    transform: scale(1.05);
}

.behance-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.behance-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 60, 94, 0.8);
    color: #ECF0F1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    padding: 20px;
    text-align: center;
}

.behance-item:hover .behance-overlay {
    opacity: 1;
}

.behance-overlay h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.behance-overlay p {
    font-size: 1em;
    margin-bottom: 15px;
}

.view-project {
    display: inline-block;
    padding: 8px 20px;
    background: #F5A623;
    color: #1A3C5E;
    text-decoration: none;
    border-radius: 20px;
    font-family: 'Poppins', sans-serif;
    transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
}

.view-project:hover {
    background: #E8B923;
    color: #ECF0F1;
}

.explore-more {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 30px;
    background: linear-gradient(45deg, #F5A623, #E8B923);
    color: #ECF0F1;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2em;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.explore-more:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.6);
}

.explore-more i {
    margin-left: 10px;
}

/* YouTube Videos Section */
.youtube-videos {
    padding: 60px 20px;  /* Reduced padding */
    text-align: center;
    background: #FFFFFF;
    animation: slideUp 1.2s ease-in-out;
}

body.dark-mode .youtube-videos {
    background: #2C3E50;
}

.youtube-videos h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.3em;
    margin-bottom: 15px;
    color: #1A3C5E;
}

body.dark-mode .youtube-videos h2 {
    color: #F5A623;
}

.youtube-videos p {
    max-width: 800px;
    margin: 0 auto 40px;
    font-size: 1.2em;
}

.youtube-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.youtube-item {
    background: #ECF0F1;
    padding: 20px;
    border-radius: 15px;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

body.dark-mode .youtube-item {
    background: #34495E;
}

.youtube-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.youtube-item iframe {
    border-radius: 10px;
    margin-bottom: 15px;
}

.youtube-item h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4em;
    margin-bottom: 10px;
    color: #1A3C5E;
}

body.dark-mode .youtube-item h3 {
    color: #ECF0F1;
}

.youtube-item p {
    font-size: 1em;
}

/* Call to Action Section */
.cta {
    padding: 60px 20px;  /* Reduced padding */
    text-align: center;
    background: #1A3C5E;
    color: #ECF0F1;
    animation: slideUp 1.4s ease-in-out;
}

body.dark-mode .cta {
    background: #34495E;
}

.cta h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.3em;
    margin-bottom: 10px;  /* Adjusted margin */
}

.cta p {
    font-size: 1.2em;
    margin-bottom: 30px;
}

.cta-button {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(45deg, #F5A623, #E8B923);
    color: #ECF0F1;
    text-decoration: none;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2em;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(245, 166, 35, 0.6);
}

/* Footer */
footer {
    padding: 40px 20px;
    background: #1A3C5E;
    color: #ECF0F1;
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

body.dark-mode footer {
    background: #2C3E50;
}

.footer-content p {
    margin-bottom: 20px;
}

.social-links a {
    color: #ECF0F1;
    margin: 0 15px;
    font-size: 1.5em;
    transition: color 0.3s ease-in-out;
}

.social-links a:hover {
    color: #F5A623;
}

/* Animations */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes slideUp {
    0% { opacity: 0; transform: translateY(50px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(26, 60, 94, 0.95);
        padding: 20px;
        text-align: center;
    }

    body.dark-mode .nav-links {
        background: rgba(44, 62, 80, 0.95);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero-content h1 {
        font-size: 2.5em;  /* Adjusted for mobile screens */
    }

    .portfolio-hero {
        height: 70vh;  /* Adjusted height for better spacing */
        padding-top: 100px;  /* Adjusted padding */
    }

    .hero-content p {
        font-size: 1.1em;  /* Adjusted font size */
        padding: 0 15px;  /* Reduced padding for smaller screens */
    }

    .behance-projects,
    .youtube-videos,
    .cta {
        padding-top: 100px;  /* Reduced padding for mobile */
    }

    .behance-projects h2,
    .youtube-videos h2,
    .cta h2 {
        font-size: 2em;  /* Adjusted for mobile screens */
    }
}