/* Enhanced Portfolio Styles */
:root {
    --primary: #A0FF00;
    --secondary: #3B82F6;
    --dark: #0A0E17;
    --card: #1C202B;
    --text-light: #f3f4f6;
    --text-dark: #9ca3af;
}

/* CSS Reset - More specific than universal selector for better performance */
html, body, div, span, h1, h2, h3, h4, h5, h6, p, a, img, ul, li, form, input, textarea, button, nav, section, article, aside, header, footer {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark);
    color: var(--text-light);
    overflow-x: hidden;
}

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

.custom-cursor.hover {
    width: 50px;
    height: 50px;
    background-color: rgba(160, 255, 0, 0.2);
    border: 2px solid var(--primary);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark) 0%, #1a1f35 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

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

.loader-circle {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(160, 255, 0, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-circle:nth-child(2) {
    animation-delay: 0.15s;
    border-top-color: var(--secondary);
}

.loader-circle:nth-child(3) {
    animation-delay: 0.3s;
    border-top-color: var(--primary);
}

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

.loader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    animation: pulse 1.5s ease-in-out infinite;
}

/* Hamburger Menu */
.hamburger {
    width: 30px;
    height: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    transition: all 0.3s ease;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: right 0.4s ease;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu a {
    font-size: 2rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    opacity: 0;
    transform: translateX(50px);
}

.mobile-menu.active a {
    animation: slideIn 0.4s ease forwards;
}

.mobile-menu.active a:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu.active a:nth-child(2) { animation-delay: 0.2s; }
.mobile-menu.active a:nth-child(3) { animation-delay: 0.3s; }
.mobile-menu.active a:nth-child(4) { animation-delay: 0.4s; }

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu a:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* Theme Toggle */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--card);
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.3s ease;
    border: 2px solid rgba(160, 255, 0, 0.3);
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle.light .theme-toggle-slider {
    transform: translateX(30px);
}

/* Scroll Progress */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9998;
    transition: width 0.1s ease;
}

/* Glassmorphism */
.glass {
    background: rgba(28, 32, 43, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Neumorphism */
.neu {
    background: var(--card);
    border-radius: 20px;
    box-shadow: 
        8px 8px 16px rgba(0, 0, 0, 0.4),
        -8px -8px 16px rgba(40, 44, 58, 0.4);
}

.neu:hover {
    box-shadow: 
        inset 4px 4px 8px rgba(0, 0, 0, 0.4),
        inset -4px -4px 8px rgba(40, 44, 58, 0.4);
}

/* 3D Canvas Container */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Animated Gradient Background */
.gradient-bg {
    background: linear-gradient(135deg, #0a0e17 0%, #1a1f35 50%, #0a0e17 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
}

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

/* Text Reveal Animation */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}

.text-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: revealText 0.8s forwards;
}

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

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
}

/* Floating Animation */
.float {
    animation: floating 3s ease-in-out infinite;
}

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

/* Parallax Layers */
.parallax-layer {
    transition: transform 0.1s ease-out;
}

/* Horizontal Scroll Container */
.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
}

/* Card Flip Effect */
.flip-card {
    perspective: 1000px;
    width: 100%;
    height: 400px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    overflow: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
    background: var(--card);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Skill Progress Circle */
.skill-circle {
    position: relative;
    width: 120px;
    height: 120px;
}

.skill-circle svg {
    transform: rotate(-90deg);
}

.skill-circle circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.skill-circle .bg-circle {
    stroke: rgba(160, 255, 0, 0.1);
}

.skill-circle .progress-circle {
    stroke: var(--primary);
    stroke-dasharray: 0 999;
    transition: stroke-dasharray 2s ease;
}

/* Button Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Magnetic Effect */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch 3s infinite;
}

@keyframes glitch {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
    98% {
        transform: translate(2px, 2px);
    }
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-left: 50px;
    margin-bottom: 50px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--primary);
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 9px;
    top: 20px;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, transparent 100%);
}

.timeline-item:last-child::after {
    display: none;
}

/* Number Counter */
.counter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

/* Blob Animation */
@keyframes blob {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.blob {
    animation: blob 7s ease-in-out infinite;
    transform: translate(-50%, -50%);
}

/* Image Parallax */
.parallax-image {
    transform: translateZ(0);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* Form Validation Feedback */
.form-input {
    position: relative;
}

.form-input input,
.form-input textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(28, 32, 43, 0.7);
    border: 2px solid transparent;
    border-radius: 10px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.form-input.error input,
.form-input.error textarea {
    border-color: #ef4444;
}

.form-input.success input,
.form-input.success textarea {
    border-color: #10b981;
}

.form-feedback {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 0.875rem;
    color: #ef4444;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.form-input.error .form-feedback {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Card Effect */
.hover-card {
    transition: all 0.3s ease;
    transform-style: preserve-3d;
}

.hover-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background-color: rgba(160, 255, 0, 0.1);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 9999px;
    transition: width 2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .custom-cursor {
        display: none;
    }
    
    .skill-circle {
        width: 100px;
        height: 100px;
    }
    
    .flip-card {
        height: 300px;
    }
}

/* Light Theme */
body.light-theme {
    --dark: #f3f4f6;
    --card: #ffffff;
    --text-light: #1f2937;
    --text-dark: #4b5563;
    background-color: var(--dark);
    color: var(--text-light);
}

body.light-theme .custom-cursor {
    mix-blend-mode: normal;
}

/* Micro-interactions */
.btn-hover {
    position: relative;
    overflow: hidden;
}

.btn-hover::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-hover:hover::before {
    width: 300px;
    height: 300px;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid var(--primary);
    border-radius: 25px;
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.scroll-indicator::before {
    content: '';
    width: 6px;
    height: 10px;
    background: var(--primary);
    border-radius: 3px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(20px);
        opacity: 0;
    }
}
