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

:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #00d4ff;
    --accent-secondary: #ff006e;
    --accent-tertiary: #7c3aed;
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.3);
    --gradient-main: linear-gradient(135deg, var(--accent), var(--accent-secondary), var(--accent-tertiary));
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Enhanced animated background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.animated-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 0, 110, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {

    0%,
    100% {
        transform: translateX(0) translateY(0);
    }

    33% {
        transform: translateX(-20px) translateY(-20px);
    }

    66% {
        transform: translateX(20px) translateY(-10px);
    }
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: var(--gradient-main);
    animation: float3d 8s ease-in-out infinite;
    opacity: 0.6;
}

.shape-1 {
    width: 100px;
    height: 100px;
    top: 15%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 75%;
    animation-delay: 2s;
}

.shape-3 {
    width: 80px;
    height: 80px;
    top: 75%;
    left: 15%;
    animation-delay: 4s;
}

.shape-4 {
    width: 120px;
    height: 120px;
    top: 30%;
    left: 70%;
    animation-delay: 6s;
}

@keyframes float3d {

    0%,
    100% {
        transform: translateY(0px) translateX(0px) rotateY(0deg) rotateX(0deg);
        opacity: 0.6;
    }

    25% {
        transform: translateY(-30px) translateX(15px) rotateY(90deg) rotateX(45deg);
        opacity: 0.8;
    }

    50% {
        transform: translateY(-15px) translateX(-20px) rotateY(180deg) rotateX(90deg);
        opacity: 0.4;
    }

    75% {
        transform: translateY(-40px) translateX(10px) rotateY(270deg) rotateX(135deg);
        opacity: 0.9;
    }
}

/* Optimized Navigation */
nav {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 35px;
    padding: 8px 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
}

nav a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 8px 14px;
    border-radius: 20px;
    display: block;
}

nav a:hover,
nav a.active {
    color: var(--accent);
    background: rgba(0, 212, 255, 0.15);
    transform: translateY(-1px);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transform: translateX(-50%);
    transition: width 0.3s ease;
    border-radius: 1px;
}

nav a:hover::after,
nav a.active::after {
    width: 70%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

/* Enhanced Hero Section */
.hero {
    text-align: center;
    position: relative;
    perspective: 1000px;
}

.hero h1 {
    font-size: 5rem;
    margin-bottom: 30px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGlow 3s ease-in-out infinite alternate;
    transform-style: preserve-3d;
}

@keyframes textGlow {
    from {
        filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.5));
        transform: rotateY(-5deg);
    }

    to {
        filter: drop-shadow(0 0 40px rgba(255, 0, 110, 0.7));
        transform: rotateY(5deg);
    }
}

.hero p {
    font-size: 1.8rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
}

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

/* Enhanced 3D Button */
.btn-3d {
    background: var(--gradient-main);
    border: none;
    padding: 18px 45px;
    border-radius: 35px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 10px 30px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}

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

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

.btn-3d:hover {
    transform: translateY(-5px) rotateX(10deg);
    box-shadow:
        0 20px 50px rgba(0, 212, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Enhanced 3D Cube */
.cube-container {
    perspective: 2000px;
    margin: 60px auto;
    width: 250px;
    height: 250px;
}

.cube {
    position: relative;
    width: 250px;
    height: 250px;
    transform-style: preserve-3d;
    animation: rotate3dAdvanced 15s linear infinite;
}

.cube-face {
    position: absolute;
    width: 250px;
    height: 250px;
    background: rgba(0, 212, 255, 0.05);
    border: 3px solid;
    border-image: var(--gradient-main) 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
}

.cube-face:hover {
    background: rgba(0, 212, 255, 0.15);
    transform: scale(1.05);
}

.cube-face.front {
    transform: translateZ(125px);
}

.cube-face.back {
    transform: rotateY(180deg) translateZ(125px);
}

.cube-face.right {
    transform: rotateY(90deg) translateZ(125px);
}

.cube-face.left {
    transform: rotateY(-90deg) translateZ(125px);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(125px);
}

.cube-face.bottom {
    transform: rotateX(-90deg) translateZ(125px);
}

@keyframes rotate3dAdvanced {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }

    33% {
        transform: rotateX(120deg) rotateY(120deg) rotateZ(60deg);
    }

    66% {
        transform: rotateX(240deg) rotateY(240deg) rotateZ(120deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(180deg);
    }
}

/* Enhanced Glass Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    padding: 35px;
    margin: 20px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.1),
        0 5px 15px rgba(0, 0, 0, 0.08);
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.8s;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    transform: translateY(-15px) rotateX(5deg) rotateY(5deg);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.2),
        0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

/* Enhanced Projects Section */
.projects-container {
    display: grid;
    gap: 30px;
    margin-top: 50px;
}

.project-category {
    margin-bottom: 60px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.category-title {
    font-size: 2.2rem;
    color: var(--accent);
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.expand-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent);
    color: var(--accent);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.expand-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: scale(1.05);
}

.expand-icon {
    transition: transform 0.3s ease;
}

.expand-btn.expanded .expand-icon {
    transform: rotate(180deg);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-grid.expanded {
    max-height: 2000px;
    margin-top: 30px;
}

.project-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
}

.project-image {
    width: 100%;
    height: 220px;
    background: var(--gradient-main);
    border-radius: 20px;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
}

.project-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(15px);
    transition: all 0.3s ease;
}

.project-card:hover .project-image::before {
    transform: translate(-50%, -50%) scale(1.1) rotateY(10deg);
}

.project-image::after {
    content: attr(data-icon);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    transition: all 0.3s ease;
}

.project-card:hover .project-image::after {
    transform: translate(-50%, -50%) scale(1.2) rotateY(-10deg);
}

.project-title {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: var(--accent);
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tech-tag {
    padding: 4px 12px;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--accent);
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--accent);
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: scale(1.05);
}

/* Enhanced Skills Section */
.skill-category {
    margin-bottom: 60px;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.skill-item {
    text-align: center;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 25px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.skill-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-main);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.skill-item:hover {
    transform: translateY(-10px) rotateY(5deg) rotateX(5deg);
    border-color: var(--accent);
    color: white;
}

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

.skill-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
    transition: all 0.3s ease;
}

.skill-item:hover .skill-icon {
    transform: scale(1.2) rotateY(360deg);
}

/* Enhanced Modal with better design */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 2000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(25px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 40px;
    max-width: 850px;
    max-height: 85vh;
    overflow-y: auto;
    margin: 20px;
    position: relative;
    transform: scale(0.9) translateY(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 25px 50px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 1.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 0, 110, 0.2);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    transform: rotate(90deg) scale(1.1);
}

.modal-image {
    width: 100%;
    height: 280px;
    background: var(--gradient-main);
    border-radius: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.modal-image::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    height: 85%;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-image::after {
    content: '🚀';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4.5rem;
    animation: modalIconFloat 3s ease-in-out infinite alternate;
}

@keyframes modalIconFloat {
    from {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
}

.modal-title {
    font-size: 2.5rem;
    margin-bottom: 25px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 35px;
}

.modal-tech .tech-tag {
    padding: 8px 18px;
    background: rgba(0, 212, 255, 0.15);
    border: 2px solid var(--accent);
    border-radius: 25px;
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 500;
    transition: all 0.3s ease;
}

.modal-tech .tech-tag:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-2px) scale(1.05);
}

.modal-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.modal-link {
    padding: 12px 30px;
    background: var(--gradient-main);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
    position: relative;
    overflow: hidden;
}

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

.modal-link:hover::before {
    left: 100%;
}

.modal-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 212, 255, 0.4);
}

.modal-link:nth-child(2) {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-tertiary));
    box-shadow: 0 8px 20px rgba(255, 0, 110, 0.3);
}

.modal-link:nth-child(2):hover {
    box-shadow: 0 15px 35px rgba(255, 0, 110, 0.4);
}

/* Section titles enhancement */
.section-title {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 50px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    animation: titleFloat 3s ease-in-out infinite alternate;
}

@keyframes titleFloat {
    from {
        transform: translateY(0px);
    }

    to {
        transform: translateY(-10px);
    }
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--gradient-main);
    border-radius: 2px;
    animation: lineGlow 2s ease-in-out infinite alternate;
}

@keyframes lineGlow {
    from {
        box-shadow: 0 0 10px var(--accent);
    }

    to {
        box-shadow: 0 0 20px var(--accent-secondary);
    }
}

/* Enhanced Animations */
.fade-in {
    opacity: 0;
    transform: translateY(50px) rotateX(-10deg);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .hero p {
        font-size: 1.3rem;
    }

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

    .skills-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .cube-container {
        width: 200px;
        height: 200px;
    }

    .cube {
        width: 200px;
        height: 200px;
    }

    .cube-face {
        width: 200px;
        height: 200px;
        font-size: 2.5rem;
    }

    nav ul {
        gap: 15px;
    }

    nav {
        padding: 6px 20px;
    }

    nav a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }


    /* Modal mobile styles */
    .modal-content {
        margin: 10px;
        padding: 25px;
        max-height: 95vh;
    }

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

    .modal-links {
        flex-direction: column;
    }

    .modal-link {
        text-align: center;
    }
}

/* Contact section mobile styles */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    justify-items: center;
    margin-top: 30px;
}

.social-link {
    width: 160px;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    color: white;
    font-weight: 600;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    backdrop-filter: blur(8px);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 25px rgba(0, 212, 255, 0.2);
}

.social-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.social-link span:last-child {
    font-size: 0.95rem;
}
