/* Custom Styles */
body {
    font-family: 'Roboto', sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

header {
    background-color: #343a40;
    color: #fff;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .navbar-brand {
    font-weight: bold;
}

.hero {
    background: linear-gradient(30deg, #6a11cb, #2575fc, #6a11cb, #2575fc);
    background-size: 500% 100%;
    color: #fff;
    padding: 80px 0;
    animation: Gradient 25s infinite;
}

@keyframes Gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero h1 {
    font-size: 3rem;
}

.about,
.portfolio,
.services,
.contact {
    padding: 60px 0;
}

.portfolio .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.portfolio .card-body {
    flex-grow: 1;
}

.portfolio .card:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

.portfolio .card img {
    padding: 15px 15px 0;
}

footer {
    background-color: #343a40;
    color: #fff;
    padding: 20px 0;
    text-align: center;
}

.social-icons a {
    color: #fff;
    margin: 0 10px;
    font-size: 1.5rem;
}

.social-icons a:hover {
    color: #6a11cb;
}

/* Dark Mode Styles */
.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode header,
.dark-mode footer {
    background-color: #1e1e1e;
}

.dark-mode .card {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

.dark-mode .btn-primary {
    background-color: #6a11cb;
    border-color: #6a11cb;
}

/* Typing Effect */
.typing-effect {
    display: inline;
    white-space: nowrap;
    overflow: hidden;
    /* Remove the border-right to avoid duplicate cursor */
    /* border-right: 3px solid #fff; */
    animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: #fff;
    }
}

/* Sun and Moon Icons */
.sun {
    width: 40%;
    height: 40%;
    position: absolute;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.6) rotate(0deg);
    transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
    background: radial-gradient(circle, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 50%, #f0f0f0 50%);
}

.sun:before {
    content: "";
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, #f0f0f0 30%, rgba(0, 0, 0, 0) 31%, rgba(0, 0, 0, 0) 50%, #f0f0f0 50%);
    transform: rotate(45deg);
}

.sun.visible {
    pointer-events: auto;
    opacity: 1;
    transform: scale(1) rotate(180deg);
    transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}

.moon {
    width: 40%;
    height: 40%;
    pointer-events: none;
    position: absolute;
    left: 12.5%;
    top: 18.75%;
    background-color: rgba(0, 0, 0, 0);
    border-radius: 50%;
    box-shadow: 9px 3px 0px 0px #f0f0f0;
    opacity: 0;
    transform: scale(0.3) rotate(65deg);
    transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}

.moon.visible {
    pointer-events: auto;
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition: transform 0.3s ease-in, opacity 0.2s ease-in 0.1s;
}

.star {
    position: absolute;
    top: 25%;
    left: 5%;
    display: block;
    width: 0px;
    height: 0px;
    border-right: 7px solid rgba(0, 0, 0, 0);
    border-bottom: 5px solid #f0f0f0;
    border-left: 7px solid rgba(0, 0, 0, 0);
    transform: scale(0.55) rotate(35deg);
    opacity: 0;
    transition: all 0.2s ease-in 0.4s;
}

.star:before {
    border-bottom: 5px solid #f0f0f0;
    border-left: 3px solid rgba(0, 0, 0, 0);
    border-right: 3px solid rgba(0, 0, 0, 0);
    position: absolute;
    height: 0;
    width: 0;
    top: -3px;
    left: -5px;
    display: block;
    content: "";
    transform: rotate(-35deg);
}

.star:after {
    position: absolute;
    display: block;
    color: red;
    top: 0px;
    left: -7px;
    width: 0px;
    height: 0px;
    border-right: 7px solid rgba(0, 0, 0, 0);
    border-bottom: 5px solid #f0f0f0;
    border-left: 7px solid rgba(0, 0, 0, 0);
    transform: rotate(-70deg);
    content: "";
}

.moon.visible .star {
    opacity: 0.8;
}

.star.small {
    transform: scale(0.35) rotate(35deg);
    position: relative;
    top: 50%;
    left: 37.5%;
    opacity: 0;
    transition: all 0.2s ease-in 0.45s;
}

.moon.visible .star.small {
    opacity: 0.7;
    transform: scale(0.45) rotate(35deg);
}

.darkModeToggle {
    width: 46px;
    height: 46px;
    box-sizing: border-box;
    padding: 12px;
    background: none;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Additional Styles for GIF Hover Effect */
.portfolio .card img.static {
    display: block;
}

.portfolio .card img.animated {
    display: none;
}
.portfolio .card video.animated {
    display: none;
}
.portfolio .card:hover img.static {
    display: none;
}

.portfolio .card:hover img.animated {
    display: block;
}

/* Modal Container */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.2s ease;
}

/* Modal Content Wrapper */
.modal-content-wrapper {
    position: relative;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
}

/* Modal Image */
.modal-content {
    max-width: 100%;
    max-height: 80vh;
    margin-bottom: 10px;
    border-radius: 4px;
}

/* Modal Caption */
.modal-caption {
    font-size: 1.1rem;
    color: #333;
    padding-top: 5px;
}

/* Close Button */
.modal-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close-button:hover,
.modal-close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Fade-in Effect */
.modal-container.show {
    opacity: 1;
    visibility: visible;
}


.modal-content-wrapper {
    background-color: var(--bs-body-bg); /* Matches the current theme's background color */
    border: none; /* Removes the border */
    color: var(--bs-body-color); /* Matches the current theme's text color */
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); /* Optional: to add a shadow for better visibility */
}

.modal-content-wrapper .modal-caption, 
.modal-content-wrapper p, 
.modal-content-wrapper h1, 
.modal-content-wrapper h2, 
.modal-content-wrapper h3, 
.modal-content-wrapper h4, 
.modal-content-wrapper h5, 
.modal-content-wrapper h6 {
    color: var(--bs-body-color); /* Adjusts text color based on the theme */
}

.dark-mode .modal-content-wrapper {
    background-color: #1e1e1e; /* Dark mode background color */
    color: #e0e0e0; /* Dark mode text color */
}

.dark-mode .modal-content-wrapper .modal-caption, 
.dark-mode .modal-content-wrapper p, 
.dark-mode .modal-content-wrapper h1, 
.dark-mode .modal-content-wrapper h2, 
.dark-mode .modal-content-wrapper h3, 
.dark-mode .modal-content-wrapper h4, 
.dark-mode .modal-content-wrapper h5, 
.dark-mode .modal-content-wrapper h6 {
    color: #e0e0e0; /* Dark mode text color */
}

.light-mode .modal-content-wrapper {
    background-color: #f8f9fa; /* Light mode background color */
    color: #212529; /* Light mode text color */
}

.light-mode .modal-content-wrapper .modal-caption, 
.light-mode .modal-content-wrapper p, 
.light-mode .modal-content-wrapper h1, 
.light-mode .modal-content-wrapper h2, 
.light-mode .modal-content-wrapper h3, 
.light-mode .modal-content-wrapper h4, 
.light-mode .modal-content-wrapper h5, 
.light-mode .modal-content-wrapper h6 {
    color: #212529; /* Light mode text color */
}

/* Modal Content Wrapper */
.modal-content-wrapper {
    position: relative;
    background-color: var(--bs-body-bg);
    padding: 15px;
    border-radius: 5px;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    overflow: hidden; /* Prevents overflow */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Modal Image */
.modal-content {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain; /* Ensures the image or video fits within the container */
    margin-bottom: 10px;
    border-radius: 4px;
}

/* Modal Video */
.modal-content video {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 4px;
}

/* Modal Caption */
.modal-caption {
    font-size: 1.1rem;
    color: var(--bs-body-color);
    padding-top: 5px;
    margin-top: auto;
    text-align: center;
}

/* Close Button */
.modal-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close-button:hover,
.modal-close-button:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Fade-in Effect */
.modal-container.show {
    opacity: 1;
    visibility: visible;
}

/* Dark Mode Styling */
.dark-mode .modal-content-wrapper {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.dark-mode .modal-caption {
    color: #e0e0e0;
}

/* Light Mode Styling */
.light-mode .modal-content-wrapper {
    background-color: #f8f9fa;
    color: #212529;
}

.light-mode .modal-caption {
    color: #212529;
}

.has-modal{
    cursor: pointer;
}
/* Rainbow Mode */
body.rainbow-mode {
    animation: rainbowBackground 5s linear infinite;
}

@keyframes rainbowBackground {
    0% { background-color: #FF0000; }
    14% { background-color: #FF7F00; }
    28% { background-color: #FFFF00; }
    42% { background-color: #00FF00; }
    57% { background-color: #0000FF; }
    71% { background-color: #4B0082; }
    85% { background-color: #8B00FF; }
    100% { background-color: #FF0000; }
}

/* Rainbow Text */
body.rainbow-mode,
body.rainbow-mode h1,
body.rainbow-mode h2,
body.rainbow-mode h3,
body.rainbow-mode h4,
body.rainbow-mode h5,
body.rainbow-mode h6,
body.rainbow-mode p,
body.rainbow-mode a,
body.rainbow-mode .navbar-brand,
body.rainbow-mode .modal-caption,
body.rainbow-mode .modal-close-button,
body.rainbow-mode .card-title,
body.rainbow-mode .card-text,
body.rainbow-mode button,
body.rainbow-mode input,
body.rainbow-mode textarea {
    animation: rainbowText 3s linear infinite;
    color: #fff !important; /* Fallback to ensure contrast */
}

@keyframes rainbowText {
    0% { color: #FF0000; }
    14% { color: #FF7F00; }
    28% { color: #FFFF00; }
    42% { color: #00FF00; }
    57% { color: #0000FF; }
    71% { color: #4B0082; }
    85% { color: #8B00FF; }
    100% { color: #FF0000; }
}

/* Rainbow Borders */
body.rainbow-mode .card,
body.rainbow-mode .navbar,
body.rainbow-mode .modal-content-wrapper,
body.rainbow-mode .modal-close-button,
body.rainbow-mode footer,
body.rainbow-mode .btn-primary,
body.rainbow-mode .darkModeToggle {
    animation: rainbowBorder 5s linear infinite;
    border-color: currentColor; /* Ensures border follows the animated text color */
}

@keyframes rainbowBorder {
    0% { border-color: #FF0000; }
    14% { border-color: #FF7F00; }
    28% { border-color: #FFFF00; }
    42% { border-color: #00FF00; }
    57% { border-color: #0000FF; }
    71% { border-color: #4B0082; }
    85% { border-color: #8B00FF; }
    100% { border-color: #FF0000; }
}

/* Rainbow Buttons and Inputs */
body.rainbow-mode .btn,
body.rainbow-mode input,
body.rainbow-mode textarea,
body.rainbow-mode .modal-close-button {
    animation: rainbowBackground 3s linear infinite, rainbowBorder 3s linear infinite;
    background-color: transparent; /* Transparent to allow animation to show */
    color: #fff !important; /* Fallback for text contrast */
    border-width: 2px;
}
/* Rainbow Mode */
body.rainbow-mode {
    animation: rainbowBackground 5s linear infinite;
    color: #fff !important; /* Ensures text is readable */
}

@keyframes rainbowBackground {
    0% { background-color: #FF0000; }
    14% { background-color: #FF7F00; }
    28% { background-color: #FFFF00; }
    42% { background-color: #00FF00; }
    57% { background-color: #0000FF; }
    71% { background-color: #4B0082; }
    85% { background-color: #8B00FF; }
    100% { background-color: #FF0000; }
}

/* Ensures text contrast on rainbow background */
body.rainbow-mode p,
body.rainbow-mode h1,
body.rainbow-mode h2,
body.rainbow-mode h3,
body.rainbow-mode h4,
body.rainbow-mode h5,
body.rainbow-mode h6,
body.rainbow-mode a,
body.rainbow-mode .navbar-brand {
    color: #fff !important;
}

/* For modals in Rainbow Mode */
body.rainbow-mode .modal-content-wrapper {
    background-color: rgba(0, 0, 0, 0.8) !important; /* Dark background for contrast */
    color: #fff !important;
}

/* Close Button in Rainbow Mode */
body.rainbow-mode .modal-close-button {
    color: #fff !important;
}


/* Dropdown menu background and styling */
.dropdown-menu {
    background-color: #343a40; /* Dark background */
    border: none; /* Remove border for a cleaner look */
    transition: opacity 0.5s ease;
    opacity: 0;
    visibility: hidden;
}

/* Display dropdown on hover */
.navbar-nav .dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Dropdown item styling */
.dropdown-item, .dropdown-item a {
    display: block;
    padding: 10px 20px; /* Adjust padding for better spacing */
    background-color: transparent;
    color: #f8f9fa; /* Light text color */
    text-decoration: none; /* Remove underline */
}

/* Hover effect for dropdown items */
.dropdown-item:hover, .dropdown-item a:hover {
    background-color: #495057; /* Darker hover effect */
    color: #ffffff; /* Ensure text is white on hover */
    text-decoration: none; /* Ensure no underline on hover */
}

/* Active/Focused Item */
.dropdown-item:focus, .dropdown-item.active, 
.dropdown-item a:focus, .dropdown-item a.active {
    background-color: #007bff; /* Primary color when active/focused */
    color: #ffffff; /* White text on active/focus */
    text-decoration: none; /* Ensure no underline on active/focus */
}

/* For the links inside the dropdown */
.dropdown-item > li {
    list-style: none; /* Remove bullets */
    margin: 0;
    padding: 0;
    color: inherit; /* Inherit color from the parent anchor */
}

/* Additional hover effect for the li inside a */
.dropdown-item:hover > li {
    color: #ffffff; /* Ensure li text color changes on hover */
}
