/* Variables for theme colors */
:root {
    --primary-color: #6c63ff;
    --secondary-color: #4db5ff;
    --accent-color: #ff6b6b;
    --text-color: #333;
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --gradient-1: linear-gradient(45deg, #6c63ff, #4db5ff);
    --gradient-2: linear-gradient(45deg, #ff6b6b, #ffb347);
    --gradient-3: linear-gradient(45deg, #4db5ff, #00f2fe);
}

.dark-theme {
    --primary-color: #8a80ff;
    --secondary-color: #64c5ff;
    --accent-color: #ff8585;
    --text-color: #e0e0e0;
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --card-shadow: rgba(0, 0, 0, 0.4);
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

section {
    padding: 80px 10%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h1, h2, h3, h4 {
    margin-bottom: 20px;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    margin-bottom: 40px;
}

h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60%;
    height: 4px;
    background: var(--gradient-1);
    border-radius: 5px;
}

p {
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

/* Header and Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(249, 249, 249, 0.8);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dark-theme header {
    background-color: rgba(18, 18, 18, 0.8);
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

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

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(30deg);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

/* Styles for the back button */
.back-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    margin-right: 20px; /* Space between back button and logo */
    transition: transform 0.3s ease;
}

.back-button:hover {
    transform: translateX(-5px);
    color: var(--primary-color);
}


/* Hero Section (for index.html) */
#hero {
    position: relative;
    overflow: hidden;
    background: var(--bg-color);
    display: flex;
    flex-direction: column; /* Overall section content arranged as column */
    justify-content: center;
    align-items: center;
    text-align: center;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Container for hero content (text) and image cards */
.hero-main-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap; /* Allows wrapping of hero-content and home-image-cards-container */
    justify-content: space-around; /* Distributes space between items */
    align-items: center; /* Vertically centers items */
    width: 100%;
    max-width: 1200px;
    padding: 20px 0;
    min-height: calc(100vh - 100px); /* Ensure enough vertical space */
    gap: 40px; /* Gap between hero-content and home-image-cards-container */
}

.hero-content {
    flex: 1 1 45%; /* flex-grow, flex-shrink, flex-basis */
    max-width: 500px; /* Limit max width for text content */
    min-width: 300px;
    text-align: left;
    margin-right: 0; /* Remove fixed margin, use gap from parent */
}

.hero-tagline {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--secondary-color);
}

.hero-cta {
    display: inline-block;
    padding: 12px 30px;
    background: var(--gradient-1);
    color: white;
    border-radius: 50px;
    font-weight: 500;
    box-shadow: 0 10px 20px rgba(108, 99, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-cta:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(108, 99, 255, 0.3);
    color: white;
}

/* New styles for image cards on home page */
.home-image-cards-container {
    position: relative;
    z-index: 2; /* Ensure it's above the canvas */
    display: flex;
    flex-direction: column; /* Changed to column for vertical arrangement */
    gap: 30px; /* Space between the two cards */
    flex-wrap: wrap; /* Allow wrapping of cards themselves if space is tight */
    justify-content: center; /* Center the cards vertically within their container */
    align-items: flex-end; /* Align cards to the right within their container */
    flex: 1 1 45%; /* flex-grow, flex-shrink, flex-basis */
    max-width: 300px; /* Max width for a single 300px card */
    min-width: 300px; /* Minimum width for the container */
    margin-left: 0; /* Remove fixed margin, use gap from parent */
    padding-bottom: 0;
}

.image-card-wrapper {
    width: 300px; /* Fixed width for the card as requested */
    height: 300px; /* Fixed height for the card as requested */
    perspective: 1000px; /* For 3D effect */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); /* Base shadow */
    border-radius: 20px;
    overflow: hidden; /* Ensures content stays within rounded corners */
    position: relative; /* For neon effect positioning */
    transition: box-shadow 0.3s ease; /* Smooth shadow transition */
}

/* Neon light effect */
.image-card-wrapper.neon-glow {
    box-shadow:
        0 0 10px var(--primary-color),
        0 0 20px var(--secondary-color),
        0 0 40px var(--accent-color),
        0 0 80px var(--primary-color);
}

.image-card-wrapper:hover.neon-glow {
    box-shadow:
        0 0 15px var(--primary-color),
        0 0 30px var(--secondary-color),
        0 0 60px var(--accent-color),
        0 0 120px var(--primary-color),
        0 0 200px var(--primary-color); /* More intense glow on hover */
}


.image-card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    text-align: center;
    transition: transform 0.8s; /* Smooth flip transition */
    transform-style: preserve-3d; /* Enable 3D space for children */
}

.image-card-wrapper:hover .image-card-inner {
    transform: rotateY(180deg); /* Flip on hover */
}

.image-card-front,
.image-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Hide back of the element when flipped */
    backface-visibility: hidden;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    overflow: hidden; /* Ensure image fits rounded corners */
}

.image-card-front {
    background: var(--gradient-1); /* Colorful background for front */
}

.image-card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area without distortion */
    border-radius: 20px; /* Inherit border-radius */
}

.image-card-back {
    background: var(--gradient-2); /* Colorful background for back */
    transform: rotateY(180deg); /* Initially rotated to be hidden */
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}
.image-card-back h3 {
    color: white;
    margin-bottom: 10px;
}
.image-card-back p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.5;
}


/* About Section */
#about {
    background-color: var(--bg-color);
    position: relative;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text {
    position: relative;
    z-index: 2;
}

.about-image {
    width:  400px;
    height: 400px;
    background-image: url('images/bigneshkumar.jpg.png'); /* Path to your image */
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin: 20px auto;
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.3);
    border: 4px solid transparent;
    animation: neon-border 2s linear infinite;
    transition: transform 0.3s ease;
    transform: perspective(600px) rotateX(5deg) rotateY(5deg);
}

.about-image:hover {
    transform: perspective(600px) rotateX(0deg) rotateY(0deg) scale(1.05);
}

/* Glowing neon border animation for about image */
@keyframes neon-border {
    0% {
        border-color: #ff00cc;
        box-shadow:
            0 0 10px #ff00cc,
            0 0 20px #ff00cc,
            0 0 40px #ff00cc;
    }
    33% {
        border-color: #00ffff;
        box-shadow:
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 40px #00ffff;
    }
    66% {
        border-color: #00ff00;
        box-shadow:
            0 0 10px #00ff00,
            0 0 20px #00ff00,
            0 0 40px #00ff00;
    }
    100% {
        border-color: #ff00cc;
        box-shadow:
            0 0 10px #ff00cc,
            0 0 20px #ff00cc,
            0 0 40px #ff00cc;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out forwards;
}

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

.education-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.education-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px var(--card-shadow);
}

.education-card h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* Skills Section */
#skills {
    background-color: var(--bg-color);
    position: relative;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.skill-category {
    margin-bottom: 40px;
}

.skill-category h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.skill-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.skill-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    width: calc(33.333% - 14px);
    min-width: 120px;
    box-shadow: 0 10px 20px var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.skill-card:hover {
    transform: translateZ(20px) rotateX(10deg) rotateY(10deg);
    box-shadow: 0 15px 35px var(--card-shadow);
}

.skill-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.skill-card h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.skill-level {
    width: 100%;
    height: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.skill-progress {
    height: 100%;
    border-radius: 3px;
    background: var(--gradient-1);
}

/* Projects Section */
#projects {
    background-color: var(--bg-color);
    position: relative;
}

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px var(--card-shadow);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card:hover {
    transform: translateZ(20px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 20px 40px var(--card-shadow);
}

.project-img {
    height: 200px;
    background: var(--gradient-2);
    position: relative;
    overflow: hidden;
}

.project-img::after {
    content: 'Project';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.project-content {
    padding: 20px;
}

.project-content h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

.project-tag {
    background-color: rgba(108, 99, 255, 0.1);
    color: var(--primary-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.project-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.project-link {
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.github-link {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.demo-link {
    background: var(--gradient-1);
    color: white;
}

/* Hobbies Section */
#hobbies {
    background-color: var(--bg-color);
    position: relative;
}

.hobbies-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.hobby-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 20px var(--card-shadow);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.hobby-card:hover {
    transform: translateZ(20px) rotateX(10deg) rotateY(10deg);
    box-shadow: 0 15px 35px var(--card-shadow);
}

.hobby-card i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.hobby-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

/* Contact Section */
#contact {
    background-color: var(--bg-color);
    position: relative;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info h3 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(108, 99, 255, 0.1);
    border-radius: 50%;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-1);
    color: white;
    font-size: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.social-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(108, 99, 255, 0.3);
    color: white;
}

.contact-form {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--card-shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
    outline: none;
}

.submit-btn {
    padding: 12px 25px;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(108, 99, 255, 0.2);
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 30px 10%;
    text-align: center;
    box-shadow: 0 -5px 20px var(--card-shadow);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.copyright {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
}

/* Modal for custom alerts */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1001; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--card-bg);
    margin: auto;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px var(--card-shadow);
    width: 80%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.close-button {
    color: var(--text-color);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

/* Responsive Design */
@media (max-width: 992px) {
    section {
        padding: 60px 5%;
    }

    header {
        padding: 15px 5%;
    }

    .about-content,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .about-image {
        height: 300px;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero-main-content {
        flex-direction: column; /* Stack content and images vertically */
        text-align: center; /* Center text when stacked */
        justify-content: center; /* Center content vertically */
    }

    .hero-content {
        margin-right: 0;
        margin-bottom: 40px; /* Add space between stacked items */
        text-align: center; /* Center text when stacked */
        max-width: 100%; /* Allow to take full width */
    }

    .home-image-cards-container {
        flex-direction: column; /* Changed to column for vertical arrangement */
        justify-content: center; /* Center the cards within the container */
        align-items: center; /* Center cards horizontally when stacked vertically */
        margin-left: 0;
        margin-bottom: 0;
    }

    .image-card-wrapper {
        width: 250px; /* Adjust size for smaller screens */
        height: 250px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--card-bg);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        gap: 15px;
        box-shadow: 0 10px 20px var(--card-shadow);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .mobile-menu-btn {
        display: block;
    }

    .skill-card {
        width: calc(50% - 10px);
    }

    .projects-container,
    .hobbies-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .hero-tagline {
        font-size: 1.2rem;
    }

    .skill-card {
        width: 100%;
    }

    .image-card-wrapper {
        width: 280px; /* Further adjust for very small screens */
        height: 280px;
    }
}
