/* Base Styles */
:root {
    /* Light Theme Color Palette */
    --primary-color: #3b82f6;  /* Blue */
    --primary-dark: #1d4ed8;   /* Darker Blue */
    --accent-color: #10b981;   /* Green */
    --text-color: #1f2937;     /* Dark Gray */
    --bg-color: #f9fafb;       /* Light Gray */
    --card-bg: #ffffff;        /* White */
    --secondary-bg: #f3f4f6;   /* Lighter Gray */
    --border-color: #e5e7eb;   /* Border Gray */
}

/* Dark Theme Variables */
.dark-theme {
    --primary-color: #60a5fa;  /* Lighter Blue */
    --primary-dark: #3b82f6;   /* Blue */
    --accent-color: #34d399;   /* Lighter Green */
    --text-color: #f3f4f6;     /* Light Gray */
    --bg-color: #111827;       /* Dark Gray/Blue */
    --card-bg: hsl(215, 28%, 17%);        /* Darker Gray */
    --secondary-bg: #374151;   /* Medium Gray */
    --border-color: #4b5563;   /* Border Gray */
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    overflow-x: hidden;
}

/* Navigation */
nav {
    background-color: var(--primary-color);
    transition: background-color 0.3s ease;
}

/* Sections */
section {
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}

section:nth-child(even) {
    background-color: var(--secondary-bg);
}

/* Cards */
.project-card .card-front {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.project-card .card-back {
    background-color: var(--primary-color);
    color: white;
}

/* Typography Animation */
.typing {
    font-size: 24px;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid;
    width: 0;
    animation: typing 3s steps(30, end) forwards, blink 0.8s infinite;
    color: var(--primary-color);
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Section Title Animation */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    color: var(--primary-color);
}

.section-title::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: 0;
    left: 50%;
    background-color: var(--accent-color);
    transition: all 0.5s ease;
    transform: translateX(-50%);
}

.section-title.animate::after {
    width: 50px;
}

/* Social Icons */
.social-icon {
    transition: transform 0.3s, color 0.3s;
    color: var(--primary-color);
}

.social-icon:hover {
    transform: scale(1.2);
    color: var(--accent-color);
}

/* Gallery Carousel */
.carousel-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.carousel-btn {
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.3s;
    background-color: var(--primary-dark);
}

.carousel-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Logo */
.logo-container {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

/* Button Animations */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    background-color: var(--primary-color);
    color: white;
}

.btn-animated:hover {
    background-color: var(--primary-dark);
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.4s;
}

.btn-animated:hover::before {
    left: 100%;
}

/* Skill Tags */
.skill-tag {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
    transition: all 0.3s;
}

.skill-tag:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: var(--primary-dark);
}

/* Profile Image Animation */
.hover-rotate {
    transition: transform 1s ease;
    border: 4px solid var(--primary-color);
}

.hover-rotate:hover {
    transform: rotate(5deg) scale(1.05);
}

/* Nav Links Animation */
/* The sidebar menu */
.sidebar {
    height: 100%; /* 100% Full-height */
    width: 0; /* 0 width - change this with JavaScript */
    position: fixed; /* Stay in place */
    z-index: 1; /* Stay on top */
    top: 0;
    left: 0;
    background-color: #1d4ed8; /* Black*/
    overflow-x: hidden; /* Disable horizontal scroll */
    padding-top: 60px; /* Place content 60px from the top */
    transition: 0.5s; /* 0.5 second transition effect to slide in the sidebar */
  }
  
  /* The sidebar links */
  .sidebar a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 25px;
    color: #000000;
    display: block;
    transition: 0.3s;
  }
  
  /* When you mouse over the navigation links, change their color */
  .sidebar a:hover {
    color: #f1f1f1;
  }
  
  /* Position and style the close button (top right corner) */
  .sidebar .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
  }
  
  
  /* Style page content - use this if you want to push the page content to the right when you open the side navigation */
  #main {
    transition: margin-left .5s; /* If you want a transition effect */
  }

  #pfp{
    transition: margin-left .5s;
  }
  
  /* On smaller screens, where height is less than 450px, change the style of the sidenav (less padding and a smaller font size) */
  @media screen and (max-height: 450px) {
    .sidebar {padding-top: 15px;}
    .sidebar a {font-size: 18px;}
  }
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -3px;
    left: 0;
    background-color: white;
    transition: width 0.3s;
}

.nav-link:hover::after {
    width: 100%;
}

/* Form Animations */
.form-group {
    position: relative;
    overflow: hidden;
}

.form-group input, 
.form-group textarea {
    transition: transform 0.3s;
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.form-group input:focus, 
.form-group textarea:focus {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

/* Back to Top Button */
.back-to-top {
    transition: all 0.3s;
    opacity: 0.7;
    background-color: var(--primary-color);
}

.back-to-top:hover {
    transform: translateY(-5px);
    opacity: 1;
}

/* Beating Heart Animation */
.beating-heart {
    animation: heartbeat 1.5s infinite;
    color: #ef4444;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

/* Fade In Animation */
.fade-in {
    opacity: 0;
    animation: fadeIn 2s forwards;
    animation-delay: 1.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Project Cards */
.project-card {
    perspective: 1000px;
    height: 450px;
    width: 100%;
    margin-bottom: 1.5rem;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.project-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
}

.card-front {
    background-color: var(--card-bg);
}

.card-back {
    background-color: var(--primary-color);
    transform: rotateY(180deg);
}

/* Make sure scroll animations work properly */
.scroll-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Animation Helper - Modified to ensure visibility */
.scroll-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animation.animate,
.project-card.animate__animated {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Force visibility for projects section */
#projects .project-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
}

/* Scroll Animation Helper */
.scroll-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Theme Toggler */
.theme-toggle-container {
    display: flex;
    align-items: center;
}

.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    appearance: none;
    background-color: var(--secondary-bg);
    border-radius: 30px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: 0.3s;
    margin: 0 8px;
}

.theme-toggle:checked {
    background-color: #000;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    background-color: #ffffff;
    transition: 0.3s;
}

.theme-toggle:checked::before {
    transform: translateX(30px);
}

.theme-toggle-icon-sun {
    color: #fff;
    font-size: 16px;
}

.theme-toggle-icon-moon {
    color:#000;
    font-size: 16px;
}
/* Blog Section Styles */

/* Blog cards with hover effects */
#blog .grid > div {
    transition: all 0.3s ease;
    height: 100%;
}

#blog .grid > div:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Blog category tags */
#blog .rounded-full {
    transition: all 0.3s ease;
}

#blog .rounded-full:hover {
    transform: scale(1.05);
}

/* Blog post animation on scroll */
#blog .scroll-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

#blog .scroll-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Blog post modal styles */
.blog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--card-bg);
    z-index: 50;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.blog-modal.active {
    opacity: 1;
    visibility: visible;
}

.blog-modal-content {
    background-color: var(--card-bg);
    margin: 50px auto;
    padding: 2rem;
    width: 90%;
    max-width: 900px;
    border-radius: 0.5rem;
    position: relative;
    color: var(--text-color);
}

.blog-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.blog-close-btn:hover {
    background-color: var(--primary-dark);
    transform: rotate(90deg);
}

/* Blog "Read More" link animation */
#blog a.hover\:underline {
    position: relative;
    text-decoration: none;
}

#blog a.hover\:underline::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

#blog a.hover\:underline:hover::after {
    width: 100%;
}

/* Blog date styling */
#blog .text-gray-500 {
    font-style: italic;
}

/* Blog image hover effect */
#blog img {
    transition: transform 0.5s ease;
}

#blog .grid > div:hover img {
    transform: scale(1.05);
}
/* Footer */
footer {
    background-color: var(--primary-dark);
    color: white;
    transition: background-color 0.3s ease;
}