/* Advanced Portfolio Styles with Animations */
:root {
    --primary-color: #8a2be2;
    --secondary-color: #9370db;
    --dark-color: #1a1a2e;
    --light-color: #ecf0f1;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --font-primary: 'Poppins', sans-serif;
}

[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #ecf0f1;
    --card-bg: rgba(255, 255, 255, 0.05);
    --nav-bg: rgba(26, 26, 46, 0.9);
}

[data-theme="light"] {
    --bg-color: #ecf0f1;
    --text-color: #1a1a2e;
    --card-bg: rgba(26, 26, 46, 0.05);
    --nav-bg: rgba(236, 240, 241, 0.9);
}

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

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

/* Custom Cursor */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.2s ease;
}

.cursor-follower {
    width: 8px;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.6s ease;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: var(--nav-bg);
    transition: background-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo span {
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-link {
    color: var(--text-color);
    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: 100%;
    height: 2px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.nav-link:hover::after {
    transform: scaleX(1);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--gradient);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.theme-toggle i {
    color: var(--light-color);
    font-size: 1.2rem;
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
    .nav-wrapper {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 100%;
        background: var(--nav-bg);
        flex-direction: column;
        justify-content: center;
        transition: right 0.3s ease;
    }

    .nav-active .nav-wrapper {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        align-items: center;
    }

    .burger {
        display: block;
        z-index: 2;
    }
}

/* Sections Common Styles */
section {
    min-height: 100vh;
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    animation: expandWidth 0.5s ease forwards 0.5s;
}

@keyframes expandWidth {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Home Section */
.home-section {
    display: flex;
    align-items: center;
    padding-top: 80px;
    background: radial-gradient(circle at top right, rgba(46, 204, 113, 0.2), transparent),
                radial-gradient(circle at bottom left, rgba(52, 152, 219, 0.2), transparent);
}

.home-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.text-zone {
    flex: 1;
}

.title {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.title-word {
    display: inline-block;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    font-weight: 700;
    letter-spacing: -1px;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transform: translateY(20px);
}

.title-word:nth-child(1) { animation-delay: 0.1s; }
.title-word:nth-child(2) { animation-delay: 0.3s; }
.title-word:nth-child(3) { animation-delay: 0.5s; }

.highlight {
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards 0.7s;
    color: var(--text-color);
}

.description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards 0.9s;
    color: var(--text-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.primary-btn {
    background: var(--gradient);
    color: white;
}

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

.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: left 0.5s ease;
}

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

/* Image Container */
.image-container {
    position: relative;
    width: 400px;
    height: 400px;
}

.image-outline {
    position: absolute;
    top: -20px;
    left: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    animation: outlineFloat 3s ease-in-out infinite;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    position: relative;
    z-index: 1;
    animation: imageFloat 3s ease-in-out infinite;
}

/* Projects Section */
.projects-section {
    padding: 6rem 0;
    background: var(--bg-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.2);
}

.project-img {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.1);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

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

.tech-tag {
    background: var(--primary-color);
    color: var(--light-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

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

.project-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    background: var(--bg-secondary);
    transition: all 0.3s ease;
    font-weight: 500;
}

.project-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-link i {
    margin-right: 8px;
    font-size: 1.1em;
}

.project-link .fa-github {
    transition: transform 0.3s ease;
}

.project-link:hover .fa-github {
    transform: rotate(360deg) scale(1.2);
}

.project-link .fa-play {
    margin-right: 8px;
}

.project-link:hover .fa-play {
    animation: pulse 1s infinite;
}

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

/* Responsive Projects Grid */
@media screen and (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-10px);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.skill-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 1rem 0;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 3px;
    transform-origin: left;
    animation: progressAnimation 1.5s ease forwards;
}

/* Contact Form */
.contact-form {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 5px;
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group label {
    position: absolute;
    top: 0;
    left: 1rem;
    transform: translateY(-50%);
    background: var(--dark-color);
    padding: 0 0.5rem;
    color: var(--text-color);
    font-size: 0.9rem;
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: float 3s ease-in-out infinite;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards 1.1s;
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--text-color);
    border-radius: 15px;
    position: relative;
    margin: 0 auto 1rem;
}

.wheel {
    width: 4px;
    height: 8px;
    background: var(--text-color);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: mouseWheel 1.5s infinite;
}

@keyframes mouseWheel {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    transform: translateY(20px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 992px) {
    .home-content {
        flex-direction: column;
        text-align: center;
    }

    .image-container {
        width: 300px;
        height: 300px;
    }

    .nav-links {
        display: none;
    }

    .burger {
        display: block;
    }
}

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

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

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

/* Glass Morphism Effects */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Loading Animation */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-animation {
    width: 50px;
    height: 50px;
    border: 3px solid var(--text-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hover Effects */
.hover-effect {
    transition: all 0.3s ease;
}

.hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-color);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Theme Transition */
.theme-transition {
    transition: background-color 0.3s ease,
                color 0.3s ease,
                border-color 0.3s ease;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes outlineFloat {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(0, -20px);
    }
}

@keyframes imageFloat {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(0, -10px);
    }
}

@keyframes progressAnimation {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0px);
    }
}

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

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
}

.video-modal.active {
    opacity: 1;
}

.video-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.youtube-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.close-video {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.close-video:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* Project card video button */
.project-link .fa-play {
    margin-right: 8px;
}

.project-link:hover .fa-play {
    animation: pulse 1s infinite;
}

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