/* Base Styles */
:root {
    --primary-color: #2a2f4f;
    --secondary-color: #4b56d2;
    --accent-color: #82c3ec;
    --gradient-primary: linear-gradient(135deg, #4b56d2, #2a2f4f);
    --gradient-secondary: linear-gradient(135deg, #82c3ec, #4b56d2);
    --text-color: #333;
    --light-text: #fff;
    --background-color: #f9f9f9;
    --card-bg: #fff;
    --navbar-height: 70px;
    --section-padding: 100px 0;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);

    /* Dark mode colors */
    --dark-bg: #121212;
    --dark-card-bg: #1e1e1e;
    --dark-text: #e0e0e0;
    --dark-secondary-text: #aaaaaa;
    --dark-accent: #6b98ff;
    --dark-border: #333333;

    /* Experience card colors */
    --dark-blue: #1a237e;
    --white-blue: #e3f2fd;
    --green: #2e7d32;
}

.dark-mode {
    --background-color: var(--dark-bg);
    --card-bg: var(--dark-card-bg);
    --text-color: var(--dark-text);
    --primary-color: var(--dark-accent);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: "Poppins", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    font-family: "Montserrat", sans-serif;
}

.section-title h2::before {
    content: "";
    position: absolute;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.section-title h2::after {
    content: "";
    position: absolute;
    width: 25px;
    height: 3px;
    background: var(--secondary-color);
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
}

section {
    padding: var(--section-padding);
    position: relative;
    overflow: hidden;
}

.section-bg-dots {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    opacity: 0.3;
    z-index: 0;
}

.section-bg-dots::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--primary-color) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Page Transitions */
.page-transition {
    opacity: 0;
    animation: fadeIn 0.8s forwards;
}

.page-content {
    min-height: calc(100vh - var(--navbar-height) - 300px);
    padding-top: calc(var(--navbar-height) + 50px);
    padding-bottom: 100px; /* Increased to ensure dots transition into footer wave */
    position: relative;
    z-index: 1;
}

.page-right {
    animation: slideInRight 0.8s forwards;
}

.page-left {
    animation: slideInLeft 0.8s forwards;
}

.page-top {
    animation: slideInTop 0.8s forwards;
}

.page-bottom {
    animation: slideInBottom 0.8s forwards;
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading Animation */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 80px;
    height: 80px;
    position: relative;
}

.loader:before,
.loader:after {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--accent-color);
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

.loader:after {
    animation-delay: -1s;
}

.loader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 0;
    }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 85px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: var(--light-text);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1.5rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    background-color: #000;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--light-text);
    max-width: 800px;
    padding: 0 20px;
}

.hero-subtitle {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards 0.5s;
    font-family: "Montserrat", sans-serif;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 5px 15px rgba(130, 195, 236, 0.3);
}

.hero-title {
    font-size: 5rem;
    font-weight: 800;
    margin-bottom: 30px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards 0.8s;
    font-family: "Montserrat", sans-serif;
    letter-spacing: 2px;
    position: relative;
}

.hero-title::before {
    content: "";
    position: absolute;
    width: 100px;
    height: 5px;
    background: var(--gradient-secondary);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
}

.hero-description {
    font-size: 1.4rem;
    max-width: 600px;
    margin: 0 auto 40px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s forwards 1.1s;
}

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

#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--light-text);
    font-size: 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: fadeIn 1s forwards 1.5s;
    z-index: 2;
}

.scroll-down i {
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

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

@keyframes bounce {
    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

/* Interactive Text */
.interactive-text {
    position: relative;
    display: inline-block;
    font-weight: 800;
    color: var(--light-text);
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.interactive-text span {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55), color 0.3s ease;
}

.interactive-text:hover span {
    color: var(--accent-color);
}

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

.about-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.about-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.statement-container {
    position: relative;
    height: 150px;
    margin: 50px 0;
    overflow: hidden;
    perspective: 1000px;
}

.statement {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(50px) rotateX(30deg);
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: var(--primary-color);
    font-family: "Montserrat", sans-serif;
}

.statement.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.statement.exit {
    opacity: 0;
    transform: translateY(-50px) rotateX(-30deg);
}

.statement span {
    display: inline-block;
    margin: 0 3px;
    animation: colorChange 5s infinite alternate;
}

@keyframes colorChange {
    0% {
        color: var(--primary-color);
    }
    50% {
        color: var(--secondary-color);
    }
    100% {
        color: var(--accent-color);
    }
}

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

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

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

.skill-category h3 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: var(--primary-color);
    font-family: "Montserrat", sans-serif;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.skill-category h3::after {
    content: "";
    position: absolute;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
    bottom: 0;
    left: 0;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.skill-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px 15px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .skill-item {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-secondary);
    opacity: 0;
    z-index: -1;
    transition: var(--transition);
}

.skill-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.skill-item:hover::before {
    opacity: 0.1;
}

.skill-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    transition: var(--transition);
}

.skill-item:hover .skill-icon {
    color: var(--accent-color);
    transform: scale(1.1);
}

.skill-name {
    font-weight: 600;
    transition: var(--transition);
}

.skill-item:hover .skill-name {
    color: var(--primary-color);
}

/* Experience Section */
.experience {
    background-color: var(--background-color);
    position: relative;
}

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

.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    position: relative;
    z-index: 1;
}

.project-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark-mode .project-item {
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.project-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    height: 220px;
    background-color: #000;
    position: relative;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: var(--transition);
}

.project-item:hover .project-image img {
    opacity: 0.9;
    transform: scale(1.05);
}

.project-link {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gradient-primary);
    color: var(--light-text);
    padding: 12px 25px;
    border-radius: 30px;
    font-weight: 600;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}

.project-item:hover .project-link {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.project-link:hover {
    box-shadow: 0 5px 15px rgba(42, 47, 79, 0.3);
    transform: translate(-50%, -50%) scale(1.05) !important;
}

.project-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-family: "Montserrat", sans-serif;
    position: relative;
    padding-bottom: 15px;
}

.project-title::after {
    content: "";
    position: absolute;
    width: 40px;
    height: 3px;
    background: var(--accent-color);
    bottom: 0;
    left: 0;
}

.project-description {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.7;
    flex-grow: 1;
}

.dark-mode .project-description {
    color: #aaa;
}

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

.project-tag {
    background-color: rgba(75, 86, 210, 0.1);
    color: var(--secondary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.project-tag:hover {
    background-color: var(--secondary-color);
    color: var(--light-text);
    transform: translateY(-3px);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .hero-title {
        font-size: 4rem;
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 3.5rem;
    }

    .hero-subtitle {
        font-size: 2rem;
    }

    .experience-card {
        flex-direction: column;
        min-height: auto;
    }

    .experience-image {
        min-height: 300px;
    }

    .experience-content {
        padding: 30px;
    }

    .experience-title {
        font-size: 2rem;
    }

    .experience-logo {
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;
    }

    .section-title h2 {
        font-size: 2.2rem;
    }

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

    .experience-image {
        min-height: 250px;
    }

    .experience-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .experience-logo {
        margin-bottom: 15px;
        margin-right: 0;
    }

    .experience-title {
        font-size: 1.8rem;
    }

    .experience-role {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .skill-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }
}
