/* Base Styles */
:root {
    /* Light Mode Colors */
    --bg-color-light: #f8f5ff;
    --text-color-light: #333;
    --accent-color-light: #6a11cb;
    --secondary-color-light: #9c27b0;
    --card-bg-light: #ffffff;
    --card-shadow-light: 0 10px 30px rgba(106, 17, 203, 0.1);
    --input-bg-light: #f0f0f0;
    
    /* Dark Mode Colors */
    --bg-color-dark: #13111a;
    --text-color-dark: #f8f5ff;
    --accent-color-dark: #9c27b0;
    --secondary-color-dark: #6a11cb;
    --card-bg-dark: #1e1b26;
    --card-shadow-dark: 0 10px 30px rgba(0, 0, 0, 0.3);
    --input-bg-dark: #2d2a38;
    
    /* Common Colors */
    --success-color: #4CAF50;
    --error-color: #F44336;
    
    /* Current Theme Colors (defaults to dark) */
    --bg-color: var(--bg-color-dark);
    --text-color: var(--text-color-dark);
    --accent-color: var(--accent-color-dark);
    --secondary-color: var(--secondary-color-dark);
    --card-bg: var(--card-bg-dark);
    --card-shadow: var(--card-shadow-dark);
    --input-bg: var(--input-bg-dark);
    
    /* Animation Speeds */
    --transition-slow: 0.5s;
    --transition-medium: 0.3s;
    --transition-fast: 0.15s;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-medium), color var(--transition-medium);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--secondary-color);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

section {
    padding: 6rem 0;
}

.highlight {
    color: var(--accent-color);
    font-weight: 600;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.theme-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-color);
    transition: opacity var(--transition-medium), transform var(--transition-medium);
}

.light-mode .theme-icon.sun,
.dark-mode .theme-icon.moon {
    opacity: 1;
    transform: scale(1);
}

.light-mode .theme-icon.moon,
.dark-mode .theme-icon.sun {
    opacity: 0;
    transform: scale(0);
    position: absolute;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.preloader-content {
    text-align: center;
    max-width: 80%;
}

.preloader-logo {
    margin-bottom: 2rem;
}

.v-logo {
    width: 120px;
    height: 120px;
}

.v-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: draw-v 2s forwards, pulse 2s infinite alternate 2s;
}

@keyframes draw-v {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes pulse {
    from {
        stroke: var(--accent-color);
        stroke-width: 5;
    }
    to {
        stroke: var(--secondary-color);
        stroke-width: 7;
    }
}

.preloader-text {
    margin-top: 2rem;
}

.message-container {
    height: 30px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.message {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s, transform 0.5s;
    position: absolute;
    width: 100%;
    text-align: center;
    left: 0;
}

.message.active {
    opacity: 1;
    transform: translateY(0);
}

.loading-bar {
    width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

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

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 1rem 0;
    background-color: rgba(19, 17, 26, 0.8);
    backdrop-filter: blur(10px);
    transition: background-color var(--transition-medium), padding var(--transition-medium);
}

.light-mode .header {
    background-color: rgba(248, 245, 255, 0.8);
}

.header.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.text-logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: text-logo-animation 3s ease-in-out infinite alternate;
}

.text-logo.small {
    font-size: 20px;
}

@keyframes text-logo-animation {
    0% {
        background-position: 0% center;
        opacity: 0.7;
    }
    40% {
        background-position: 100% center;
        opacity: 1;
    }
    60% {
        background-position: 100% center;
        opacity: 1;
    }
    100% {
        background-position: 0% center;
        opacity: 0.7;
    }
}

.nav ul {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width var(--transition-medium);
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

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

.hero-text {
    flex: 1;
    z-index: 1;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    position: relative;
}

.glitch {
    position: relative;
    color: var(--text-color);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    color: var(--accent-color);
    z-index: -1;
    animation: glitch-animation 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    animation-delay: 0.1s;
}

.glitch::after {
    color: var(--secondary-color);
    z-index: -2;
    animation: glitch-animation 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
    animation-delay: 0.2s;
}

@keyframes glitch-animation {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-3px, 3px);
    }
    40% {
        transform: translate(-3px, -3px);
    }
    60% {
        transform: translate(3px, 3px);
    }
    80% {
        transform: translate(3px, -3px);
    }
    100% {
        transform: translate(0);
    }
}

.hero h2 {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

.hero-visual {
    flex: 1;
    position: relative;
    height: 500px;
}

.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-shape {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -1;
}

.blob {
    animation: blob-animation 15s infinite alternate;
}

@keyframes blob-animation {
    0% {
        d: path("M416.7,143.9c27.3,46.9,27.3,113.1,1.7,168.2c-25.6,55.1-76.8,99.1-134.6,117.7c-57.8,18.6-122.2,11.8-178.5-15.2C48.9,387.6,0.7,340.4,0,293.1c-0.7-47.3,46.1-94.7,83.8-141.9C121.5,104,150,57,193.5,31.4c43.5-25.6,102-29.8,147.3,0C386.1,61.2,389.4,97,416.7,143.9z");
    }
    50% {
        d: path("M380.5,146.2c36.8,49.6,73.6,99.1,68.2,147.3c-5.4,48.2-53,95.1-106.5,117.7c-53.5,22.6-112.9,20.9-168.2,2.6c-55.3-18.3-106.5-53.3-131.2-104.7C17.9,257.6,19.6,190,47.7,139.4C75.8,88.8,130.3,55.2,188.1,41.5c57.8-13.7,118.9-7.4,163.3,20.9C396,90.7,423.7,141,380.5,146.2z");
    }
    100% {
        d: path("M423.8,144.8c28.2,47.9,28.2,116.1,1.7,172.5c-26.5,56.4-79.4,101.1-139.2,120.3c-59.8,19.2-126.5,12.8-184.6-15.3c-58.1-28.1-107.6-77.9-108.5-126.5c-0.9-48.6,47.1-96,85.9-144.3c38.8-48.3,68.1-97.5,113-124.3c44.9-26.8,105.3-30.2,152.2,0C391.2,60.4,395.6,96.9,423.8,144.8z");
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    transform: scale(0);
    transition: transform 0.5s;
    border-radius: 50px;
}

.btn:hover::before {
    transform: scale(2);
}

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

.btn:active {
    transform: translateY(0);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.btn-text {
    z-index: 1;
}

.btn-arrow,
.btn-icon {
    width: 20px;
    height: 20px;
    margin-left: 10px;
    transition: transform var(--transition-fast);
    z-index: 1;
}

.btn:hover .btn-arrow {
    transform: translateX(5px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

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

.btn-secondary:hover {
    background-color: rgba(106, 17, 203, 0.1);
}

.full-width {
    width: 100%;
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-line {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    margin: 0 auto;
    border-radius: 2px;
}

/* About Section */
.about-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.about-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-text p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.about-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.card {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium);
    text-align: center;
}

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

.card-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    color: var(--accent-color);
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* Technology Stack Section */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform var(--transition-medium);
}

.tech-item:hover {
    transform: translateY(-10px);
}

.tech-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    filter: grayscale(100%);
    transition: filter var(--transition-medium), transform var(--transition-medium);
}

.tech-item:hover .tech-icon {
    filter: grayscale(0%);
    transform: scale(1.1);
}

.tech-name {
    font-weight: 600;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background-color: var(--card-bg);
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-divider {
    color: var(--text-color);
    opacity: 0.5;
}

.footer-copyright {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-medium), visibility var(--transition-medium);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--card-shadow);
    transform: translateY(50px);
    opacity: 0;
    transition: transform var(--transition-medium), opacity var(--transition-medium);
}

.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.close-modal:hover {
    transform: rotate(90deg);
}

.close-modal svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 1.5rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.input-focus-effect {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--secondary-color));
    transition: width var(--transition-medium);
}

input:focus ~ .input-focus-effect,
textarea:focus ~ .input-focus-effect {
    width: 100%;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Light Mode Styles */
.light-mode {
    --bg-color: var(--bg-color-light);
    --text-color: var(--text-color-light);
    --accent-color: var(--accent-color-light);
    --secondary-color: var(--secondary-color-light);
    --card-bg: var(--card-bg-light);
    --card-shadow: var(--card-shadow-light);
    --input-bg: var(--input-bg-light);
}

/* Media Queries */
@media (max-width: 992px) {
    html {
        font-size: 14px;
    }
    
    .hero-content {
        flex-direction: column;
    }
    
    .hero-text {
        text-align: center;
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-visual {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .nav ul {
        gap: 1rem;
    }
    
    .about-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .tech-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .nav {
        display: none;
    }
}
