html,
body {
    height: 100%;
    overflow-x: hidden;
    min-height: 100vh; /* Ensure html and body are at least viewport height */
    box-sizing: border-box; /* Include padding and border in element's total width and height */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    scroll-behavior: smooth;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-attachment: fixed;
    padding-top: 56px; /* Ensure content is below the fixed navbar */
}

main {
    flex: 1 0 auto;
    padding-top: 56px; /* Height of navbar */
}

footer {
    width: 100%;
    background-color: #212529;
    color: white;
    padding: 0.25rem 0;
    z-index: 1000;
    transform: translateY(0) !important;
    transition: transform 0.3s ease-in-out;
}

footer.show-at-bottom {
    transform: translateY(0);
}

/* Navbar styles (fixed at top) */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 99%;
    z-index: 1030;
    background-color: #212529;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0;
    padding: 0;
}

.navbar.show-at-bottom {
    transform: translateY(0);
}

/* Footer styles (fixed at bottom) */
.footer {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1040 !important; /* High z-index, but below navbar */
    background-color: #212529 !important; /* Ensure it has a background to cover content */
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* Remaining original styles */
#about .col-md-5 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

#about img {
    margin-top: -24px;
    width: 60%;
    max-width: 250px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    border: 4px solid #fff;
    background: #fff;
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
}

@media (max-width: 767px) {
    #about img {
        margin-top: 0;
    }
}

header {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    overflow: hidden;
    padding-top: 0;
    margin-top: 0;
    min-height: 100vh;
}

header .container {
    padding-top: 56px;
}

.card {
    transition: transform 0.3s ease-in-out;
}

.card:hover {
    transform: translateY(-10px);
}

.navbar-brand {
    font-weight: bold;
}

section {
    padding: 2rem 0;
    position: relative; /* Ensure stacking context for z-index */
    z-index: 1; /* Keep sections below fixed navbar */
}

.skill-circle {
    width: 100px;
    height: 100px;

    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    text-transform: uppercase;
    margin: 10px;
}

/* Style for section titles */
h2.text-center {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 15px;
}

h2.text-center::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
}

/* Contact section styles */
#contact .p-4.border {
    background: rgba(26, 26, 46, 0.4) !important;
    border-color: rgba(255, 215, 0, 0.15) !important;
    /* backdrop-filter: blur(5px); */ /* Removed as it can interfere with fixed positioning */
}

#contact form .form-label {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

#contact form .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

#contact form .form-control::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#contact form .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #ffd700;
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(255, 215, 0, 0.25);
}

#contact form .btn-primary {
    background: rgba(255, 215, 0, 0.9);
    border-color: rgba(255, 215, 0, 0.9);
    color: #1a1a2e;
    font-weight: 600;
}

#contact form .btn-primary:hover {
    background: rgba(255, 215, 0, 1);
    border-color: rgba(255, 215, 0, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.2);
}

/* LinkedIn and social icons styles */
.linkedin-icon {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.linkedin-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.linkedin-icon i {
    color: #ffffff;
    font-size: 1.5rem;
}

.linkedin-icon span {
    color: #ffffff;
    font-size: 1.1rem;
    margin-left: 8px;
}

/* Animated background elements */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    animation: slide 20s linear infinite;
}

/* Floating particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

.particle:nth-child(1) {
    left: 10%;
    animation-duration: 15s;
}

.particle:nth-child(2) {
    left: 20%;
    animation-duration: 20s;
}

.particle:nth-child(3) {
    left: 30%;
    animation-duration: 25s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-duration: 18s;
}

.particle:nth-child(5) {
    left: 50%;
    animation-duration: 22s;
}

.particle:nth-child(6) {
    left: 60%;
    animation-duration: 17s;
}

.particle:nth-child(7) {
    left: 70%;
    animation-duration: 23s;
}

.particle:nth-child(8) {
    left: 80%;
    animation-duration: 19s;
}

.particle:nth-child(9) {
    left: 90%;
    animation-duration: 21s;
}

/* Home content animations */
header .container {
    position: relative;
    z-index: 2;
}

header h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease-out;
}

header .lead {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.5s both;
}

header .btn-warning {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: fadeInUp 1s ease-out 1s both;
    transition: all 0.3s ease;
}

header .btn-warning:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slide {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 100px 100px;
    }
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }

    100% {
        transform: translateY(0) rotate(360deg);
    }
}

/* Content animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#about h2 {
    color: #ffd700;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    padding-bottom: 15px;
}

#about h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #ffd700;
    border-radius: 2px;
}

/* Responsive Design Rules */
@media (max-width: 1200px) {
    header h1 {
        font-size: 3.5rem;
    }

    header .lead {
        font-size: 1.6rem;
    }
}

@media (max-width: 992px) {
    header h1 {
        font-size: 3rem;
    }

    header .lead {
        font-size: 1.4rem;
    }

    .skill-circle {
        width: 80px;
        height: 80px;
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    header .lead {
        font-size: 1.2rem;
    }

    .skill-circle {
        width: 70px;
        height: 70px;
        font-size: 0.7rem;
    }

    h2.text-center {
        font-size: 2rem;
    }

    .card {
        width: 90% !important;
        margin: 0 auto 20px;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .nav-link {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    header h1 {
        font-size: 2rem;
    }

    header .lead {
        font-size: 1rem;
    }

    .skill-circle {
        width: 60px;
        height: 60px;
        font-size: 0.6rem;
    }

    h2.text-center {
        font-size: 1.8rem;
    }

    .btn-warning {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar-nav {
        flex-direction: column;
    }

    .nav-item {
        margin: 5px 0;
    }
}

/* Fix for mobile navigation */
@media (max-width: 991px) {
    .sliding-bar {
        display: none;
    }

    .navbar-collapse {
        background: rgba(26, 26, 46, 0.95);
        padding: 1rem;
        border-radius: 8px;
        margin-top: 10px;
    }

    .navbar-nav {
        gap: 10px;
    }

    .nav-link {
        padding: 0.8rem 1rem;
        text-align: center;
    }
}

/* Responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Responsive form elements */
.form-control {
    max-width: 100%;
}

/* Responsive grid adjustments */
.row {
    margin-left: -15px;
    margin-right: -15px;
}

.col,
[class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* Responsive spacing */
@media (max-width: 768px) {
    section {
        padding-top: 15px;
        padding-bottom: 40px;
    }

    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }
}

/* Responsive contact section */
@media (max-width: 768px) {

    #contact .col-md-5,
    #contact .col-md-7 {
        margin-bottom: 30px;
    }

    .linkedin-icon {
        padding: 8px 12px;
    }
}

/* Responsive project cards */
@media (max-width: 768px) {
    .card {
        width: 100% !important;
    }

    .card-img-top {
        height: 200px;
        object-fit: cover;
    }
}

/* Responsive resume section */
@media (max-width: 768px) {
    .resume-iframe {
        height: 300px;
    }

    .resume-overlay .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* Original styles for nav-link and active state */
.nav-link {
    position: relative;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffd700 !important;
}

/* Original navbar style that might be affected by Bootstrap */
.navbar {
    /* The original relative positioning might have caused issues, fixed above */
    /* Removed original overflow: hidden; as it's now handled by body */
}

/* Original sliding bar (if still used, ensures it works with fixed navbar) */
.sliding-bar {
    position: absolute;
    bottom: 0;
    height: 3px;
    background-color: #ffd700;
    transition: all 0.3s ease;
}

/* Experience section company logos */
#exp .card-body .rounded-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Ensure sections have proper spacing */
section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 2rem;
}