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

:root {
    --primary: #ff4d4d;
    --secondary: #f9cb28;
    --dark: #000;
    --light: #fff;
    --gray: #ccc;
    --dark-bg: #0a0a0a;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--dark);
    color: var(--light);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Preloader Styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loader-text {
    font-size: 1.2rem;
    color: var(--light);
}

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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 3rem;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    z-index: 1000;
    transition: all 0.3s ease;
    background: transparent;
}

.header.scrolled {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 3px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.5s ease;
}

.logo:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.tagline {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-left: 1rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--light);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--secondary);
}

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

.main-content {
    padding: 2rem 0;
    margin-top: 80px;
}

.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    margin-bottom: 5rem;
    min-height: 80vh;
}

.hero-text {
    flex: 1;
}

.hero-image {
    flex: 0 0 300px;
    position: relative;
    perspective: 1000px;
}

.profile-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    transform: rotateY(10deg) rotateX(5deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s ease;
}

.hero-image:hover .profile-image {
    transform: rotateY(0) rotateX(0);
}

.name {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--light), var(--gray));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    position: relative;
    overflow: hidden;
}

.name::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    100% {
        left: 100%;
    }
}

.title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.description {
    max-width: 600px;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 3rem;
    color: var(--gray);
    position: relative;
    padding-left: 2rem;
}

.description::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.skill {
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    cursor: default;
}

.skill:hover {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 77, 77, 0.3);
}

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 77, 77, 0.3);
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

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

.cta-btn.secondary {
    background: transparent;
    color: var(--light);
    border: 2px solid var(--primary);
}

/* Projects Section */
.section {
    padding: 5rem 0;
    position: relative;
}

.section-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

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

.project-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.project-card:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: 0 15px 30px rgba(255, 77, 77, 0.2);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--gray);
    margin-bottom: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tech-tag {
    padding: 0.3rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link:hover {
    color: var(--secondary);
    transform: translateX(5px);
}

/* Contact Section */
.contact-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 3rem;
    margin-top: 3rem;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: var(--light);
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.2);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

.submit-btn {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 1rem;
}

/* Social Section positioned at the side edge */
.social-section-edge {
    position: flex-end;
    right: 2rem;
    bottom: 2rem;
    text-align: right;
    z-index: 100;
}

.connect {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.social-links {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.social-icons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: flex-end;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
    transform: translateY(-3px);
}

.credit {
    position: absolute;
    right: 2rem;
    bottom: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.5;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-element {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    opacity: 0.2;
    animation: float 15s infinite linear;
}

.floating-element:nth-child(2) {
    width: 20px;
    height: 20px;
    top: 20%;
    left: 80%;
    animation-duration: 20s;
    background: linear-gradient(45deg, var(--secondary), var(--primary));
}

.floating-element:nth-child(3) {
    width: 40px;
    height: 40px;
    top: 60%;
    left: 10%;
    animation-duration: 25s;
}

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

    25% {
        transform: translate(20px, 50px) rotate(90deg);
    }

    50% {
        transform: translate(40px, 0) rotate(180deg);
    }

    75% {
        transform: translate(20px, -50px) rotate(270deg);
    }

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

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

/* AI Chat Navigation */
.ai-chat {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

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

.chat-container {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 350px;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: none;
    backdrop-filter: blur(10px);
}

.chat-container.active {
    display: block;
}

.chat-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-header i {
    color: var(--primary);
}

.chat-messages {
    height: 300px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 0.8rem 1rem;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    color: var(--dark);
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light);
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input input {
    flex: 1;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 20px;
    color: var(--light);
    font-family: 'Montserrat', sans-serif;
}

.chat-input input:focus {
    outline: none;
}

.chat-input button {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

/* Parallax Elements */
.parallax-element {
    position: absolute;
    z-index: -1;
}

/* Form Status Messages */
.form-status {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

.form-status.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #4CAF50;
    display: block;
}

.form-status.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #F44336;
    display: block;
}

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

    .title {
        font-size: 1.8rem;
    }

    .description {
        font-size: 1rem;
    }

    .hero-section {
        flex-direction: column;
    }

    .hero-image {
        flex: 0 0 auto;
        width: 250px;
        margin: 0 auto;
    }

    .social-section-edge {
        position: relative;
        right: auto;
        bottom: auto;
        text-align: center;
        margin-top: 2rem;
    }

    .social-icons {
        justify-content: center;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.9);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        z-index: 100;
    }

    .nav-links.active {
        display: flex;
    }

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

    .cta-buttons {
        flex-direction: column;
        align-items: flex-start;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
    }

    .contact-form {
        grid-template-columns: 1fr;
    }

    .ai-chat {
        left: 1rem;
        bottom: 1rem;
    }

    .chat-container {
        width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .name {
        font-size: 2.5rem;
    }

    .title {
        font-size: 1.5rem;
    }

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

    .chat-container {
        width: 280px;
    }
}
