@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Orbitron:wght@400;500;700;900&display=swap');

/* Theme Variables */
:root {
    /* Dark theme (default) */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: #a0a0a0;
    --text-accent: #667eea;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.1);
    --hover-bg: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    /* Light theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e2e8f0;
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #718096;
    --text-accent: #667eea;
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --input-bg: rgba(255, 255, 255, 0.8);
    --hover-bg: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.font-orbitron {
    font-family: 'Orbitron', sans-serif;
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 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%; }
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.glass-strong {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    opacity: 0.9;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.glow-hover:hover {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.8);
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.float {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(102, 126, 234, 0.5);
    border-radius: 50%;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

.tech-card {
    transition: all 0.3s ease;
}

.tech-card:hover {
    transform: scale(1.05) rotateY(5deg);
    background: rgba(102, 126, 234, 0.1);
}

html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 5px;
}

nav {
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

nav.scrolled {
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.testimonial-card {
    transition: all 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.portfolio-item {
    position: relative;
    overflow: hidden;
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    pointer-events: none;
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
    pointer-events: all;
}

.portfolio-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 
                0 0 30px rgba(102, 126, 234, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.portfolio-image {
    position: relative;
    overflow: hidden;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.98), rgba(30, 30, 60, 0.98));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: sticky;
    top: 10px;
    right: 10px;
    float: right;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.btn-pulse {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(102, 126, 234, 0);
    }
}

.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 100;
}

.mobile-menu.active {
    transform: translateX(0);
}

@media (max-width: 768px) {
    nav .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

input, textarea {
    color: #000;
}

input::placeholder, textarea::placeholder {
    color: #666;
}

/* AI Loader Styles */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 50%, #0a0a0a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-wrapper.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* Animated Rings */
.loader-rings {
    position: relative;
    width: 150px;
    height: 150px;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 3px solid transparent;
}

.ring-1 {
    width: 150px;
    height: 150px;
    border-top-color: #667eea;
    border-right-color: #764ba2;
    animation: spinRing 2s linear infinite;
    top: 0;
    left: 0;
}

.ring-2 {
    width: 120px;
    height: 120px;
    border-bottom-color: #f093fb;
    border-left-color: #667eea;
    animation: spinRing 1.5s linear infinite reverse;
    top: 15px;
    left: 15px;
}

.ring-3 {
    width: 90px;
    height: 90px;
    border-top-color: #f093fb;
    border-right-color: #764ba2;
    animation: spinRing 1s linear infinite;
    top: 30px;
    left: 30px;
}

@keyframes spinRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Center Orb */
.loader-orb {
    position: absolute;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.8),
                0 0 60px rgba(118, 75, 162, 0.6),
                0 0 90px rgba(240, 147, 251, 0.4);
    animation: pulseOrb 2s ease-in-out infinite;
}

@keyframes pulseOrb {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 30px rgba(102, 126, 234, 0.8),
                    0 0 60px rgba(118, 75, 162, 0.6),
                    0 0 90px rgba(240, 147, 251, 0.4);
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 50px rgba(102, 126, 234, 1),
                    0 0 80px rgba(118, 75, 162, 0.8),
                    0 0 110px rgba(240, 147, 251, 0.6);
    }
}

/* Floating Particles */
.loader-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #667eea;
    border-radius: 50%;
    animation: floatParticle 3s ease-in-out infinite;
}

.loader-particle:nth-child(1) {
    top: -30px;
    left: 50%;
    animation-delay: 0s;
    background: #667eea;
}

.loader-particle:nth-child(2) {
    top: 50%;
    right: -30px;
    animation-delay: 0.5s;
    background: #764ba2;
}

.loader-particle:nth-child(3) {
    bottom: -30px;
    left: 50%;
    animation-delay: 1s;
    background: #f093fb;
}

.loader-particle:nth-child(4) {
    top: 50%;
    left: -30px;
    animation-delay: 1.5s;
    background: #667eea;
}

@keyframes floatParticle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(0, -20px) scale(1.5);
        opacity: 1;
    }
}

/* Loading Text */
.loader-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #667eea);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Loading Dots */
.loader-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: bounceDot 1.4s ease-in-out infinite;
}

.dot:nth-child(1) {
    animation-delay: 0s;
    background: #667eea;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
    background: #764ba2;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
    background: #f093fb;
}

@keyframes bounceDot {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Percentage Counter */
.loader-percentage {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    color: #667eea;
    font-weight: 600;
    letter-spacing: 2px;
}

.tech-tag {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Filter buttons for portfolio */
.filter-btn {
    padding: 10px 24px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Portfolio Content Styling */
.portfolio-content {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* AI-Powered Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: rgba(10, 10, 30, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: scale(0) rotate(-180deg);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 2px solid transparent;
    overflow: visible;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1) rotate(0deg);
}

.back-to-top::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: conic-gradient(from 0deg, #667eea, #764ba2, #f093fb, #667eea);
    border-radius: 50%;
    z-index: -1;
    animation: neuralRotate 3s linear infinite;
}

.back-to-top::after {
    content: '';
    position: absolute;
    inset: -8px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.4), transparent 70%);
    border-radius: 50%;
    z-index: -2;
    filter: blur(15px);
    opacity: 0;
    transition: opacity 0.4s;
    animation: pulse 2s ease-in-out infinite;
}

.back-to-top:hover {
    transform: scale(1.15) rotate(0deg);
    background: rgba(10, 10, 30, 1);
}

.back-to-top:hover::after {
    opacity: 1;
}

.back-to-top:active {
    transform: scale(0.95);
}

.back-to-top i {
    font-size: 22px;
    background: linear-gradient(135deg, #667eea, #f093fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: aiPulse 2s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes neuralRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes aiPulse {
    0%, 100% { 
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
    50% { 
        transform: translateY(-3px) scale(1.1);
        filter: brightness(1.3);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.6;
    }
}

/* Mail Login Page Specific Styles */
.mail-login-form input[type="email"],
.mail-login-form input[type="password"],
.mail-login-form input[type="url"] {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.mail-login-form input[type="email"]:focus,
.mail-login-form input[type="password"]:focus,
.mail-login-form input[type="url"]:focus {
    border-color: var(--text-accent);
    background: var(--input-bg);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.mail-login-form input::placeholder {
    color: var(--text-muted);
}

.mail-login-form label {
    color: var(--text-secondary);
}

.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.service-card:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
}

[data-theme="light"] .service-card:hover {
    background: rgba(102, 126, 234, 0.1);
}

[data-theme="light"] .mail-login-form input[type="email"],
[data-theme="light"] .mail-login-form input[type="password"],
[data-theme="light"] .mail-login-form input[type="url"] {
    background: var(--input-bg);
    border: 1px solid #e2e8f0;
    color: var(--text-primary);
}

[data-theme="light"] .mail-login-form input[type="email"]:focus,
[data-theme="light"] .mail-login-form input[type="password"]:focus,
[data-theme="light"] .mail-login-form input[type="url"]:focus {
    background: #ffffff;
    border-color: var(--text-accent);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}