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

:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --card-bg: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-blue: #1E90FF;
    --accent-blue-hover: #4169E1;
    --border-color: #333;
}

/* Smooth scrolling and full viewport sections */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed navbar */
}

/* Each section takes full viewport height and is centered */
section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--primary-bg);
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Mobile background fix */
@supports (-webkit-touch-callout: none) {
    body {
        background-attachment: scroll;
        min-height: 100vh;
    }
}

/* Animated overlay on top of background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(30, 144, 255, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(30, 144, 255, 0.03) 0%, transparent 40%),
        linear-gradient(135deg, rgba(10, 10, 10, 0.7) 0%, rgba(26, 26, 26, 0.6) 100%);
    z-index: -2;
    animation: bgShift 20s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(90deg, rgba(30, 144, 255, 0.03) 1px, transparent 1px),
        linear-gradient(180deg, rgba(30, 144, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    animation: gridMove 30s linear infinite;
}

@keyframes bgShift {
    0% { 
        background: 
            radial-gradient(circle at 20% 20%, rgba(30, 144, 255, 0.05) 0%, transparent 40%),
            radial-gradient(circle at 80% 80%, rgba(30, 144, 255, 0.03) 0%, transparent 40%),
            linear-gradient(135deg, rgba(10, 10, 10, 0.7) 0%, rgba(26, 26, 26, 0.6) 100%);
    }
    100% { 
        background: 
            radial-gradient(circle at 80% 20%, rgba(65, 105, 225, 0.04) 0%, transparent 40%),
            radial-gradient(circle at 20% 80%, rgba(30, 144, 255, 0.04) 0%, transparent 40%),
            linear-gradient(135deg, rgba(26, 26, 26, 0.6) 0%, rgba(10, 10, 10, 0.7) 100%);
    }
}

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

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    /* background-color: rgba(10, 10, 10, 0.7); */
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(2px);
    z-index: 1000;
    border: none;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
}

.logo img {
    border-radius: 8px;
    object-fit: contain;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn.active,
.lang-btn:hover {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    transition: right 0.3s ease;
    z-index: 1000;
    padding-top: 80px;
    border-left: 1px solid var(--border-color);
}

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

.mobile-nav-links {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mobile-nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: color 0.3s ease;
}

.mobile-nav-links a:hover {
    color: var(--accent-blue);
}

.mobile-language-switcher {
    padding: 0 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.mobile-lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.mobile-lang-btn.active,
.mobile-lang-btn:hover {
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Hero Section */
.hero {
    background: rgba(10, 10, 10, 0.3);
    backdrop-filter: blur(2px);
    padding-top: 80px; /* Add padding to prevent content being hidden under navbar */
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 500px;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 400px;
}

.code-blocks {
    position: relative;
    width: 100%;
    height: 100%;
}

.code-block {
    position: absolute;
    background-color: var(--card-bg);
    border: 1px solid var(--accent-blue);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 0 20px rgba(30, 144, 255, 0.3);
}

.code-block.large {
    width: 250px;
    height: 180px;
    top: 20px;
    right: 50px;
    animation: float 6s ease-in-out infinite;
}

.code-block.medium {
    width: 200px;
    height: 140px;
    top: 120px;
    left: 20px;
    animation: float 6s ease-in-out infinite 2s;
}

.code-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.dots {
    display: flex;
    gap: 0.3rem;
}

.dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-blue);
}

.code-lines {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.line {
    height: 4px;
    background-color: var(--accent-blue);
    border-radius: 2px;
}

.line.short {
    width: 60%;
}

.line.medium {
    width: 80%;
}

.gear-icon {
    position: absolute;
    top: 200px;
    right: 20px;
    animation: rotate 20s linear infinite;
}

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

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

/* About Section */
.about {
    background: rgba(10, 10, 10, 0.3);
    backdrop-filter: blur(2px);
}

/* .about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="circuit" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M2 2h16v16H2z" fill="none" stroke="rgba(30,144,255,0.1)" stroke-width="0.5"/><circle cx="10" cy="10" r="1" fill="rgba(30,144,255,0.2)"/></pattern></defs><rect width="100" height="100" fill="url(%23circuit)"/></svg>');
    opacity: 0.3;
    z-index: 0;
} */

.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.about-content h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 3rem;
}

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

.stat {
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(42, 42, 42, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.stat:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(30, 144, 255, 0.2);
}

.stat-icon {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.stat h3 {
    font-size: 2.5rem;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.stat p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.about-visual {
    position: relative;
    height: 400px;
}

.tech-stack {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    align-content: center;
}

.tech-item {
    animation: techFloat 6s ease-in-out infinite;
    animation-delay: var(--delay);
}

.tech-icon {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-hover));
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 5px 15px rgba(30, 144, 255, 0.3);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tech-item:hover .tech-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(30, 144, 255, 0.4);
}

@keyframes techFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) rotate(1deg);
    }
    66% {
        transform: translateY(-5px) rotate(-1deg);
    }
}

/* Services Section */
.services {
    background: rgba(10, 10, 10, 0.3);
    backdrop-filter: blur(2px);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.service-card {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(30, 144, 255, 0.2);
}

.service-icon {
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Contact Section */
.contact {
    background: rgba(10, 10, 10, 0.3);
    backdrop-filter: blur(2px);
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h2 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Contact Form */
.contact-form {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    background-color: var(--primary-bg);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.1);
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group input:focus + label,
.form-group textarea:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:not(:placeholder-shown) + label {
    transform: translateY(-2.5rem) scale(0.9);
    color: var(--accent-blue);
}

.captcha-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.submit-btn {
    width: 100%;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: var(--accent-blue-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 144, 255, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    display: none;
}

.form-message.success {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

.form-message.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
}

/* Footer */
.footer {
    background: rgba(26, 26, 26, 0.9);
    backdrop-filter: blur(2px);
    padding: 4rem 0 2rem;
    position: relative;
    overflow: hidden;
    /* Override section styles for footer */
    min-height: auto;
    display: block;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h4 {
    color: var(--accent-blue);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-section .logo {
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a,
.contact-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover,
.contact-links a:hover {
    color: var(--accent-blue);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Tech background for footer */
.tech-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: -100;
    opacity: 0.1;
}

.circuit-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--accent-blue) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, var(--accent-blue) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px;
    animation: circuitPulse 8s ease-in-out infinite;
}

.code-rain {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.code-line {
    position: absolute;
    color: var(--accent-blue);
    font-family: 'Courier New', monospace;
    font-size: 12px;
    white-space: nowrap;
    animation: codeRain var(--duration) linear infinite;
    animation-delay: var(--delay);
}

.code-line:nth-child(1) { left: 10%; }
.code-line:nth-child(2) { left: 25%; }
.code-line:nth-child(3) { left: 45%; }
.code-line:nth-child(4) { left: 65%; }
.code-line:nth-child(5) { left: 85%; }

@keyframes circuitPulse {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

@keyframes codeRain {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }
    10%, 90% {
        opacity: 1;
    }
    100% {
        transform: translateY(400px);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile background fix */
    body {
        background-attachment: scroll;
        min-height: 100vh;
    }
    
    .nav-container {
        justify-content: space-between;
        padding: 1rem;
    }
    
    .nav-links,
    .language-switcher {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    /* Increase hero padding on mobile */
    .hero {
        padding-top: 100px;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .about-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-content h2 {
        font-size: 2.5rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tech-stack {
        justify-content: center;
        gap: 0.5rem;
    }
    
    .contact-container {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        text-align: center;
    }
    
    .contact-info h2 {
        font-size: 2rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Force background to work on very small screens */
    body {
        background-attachment: scroll !important;
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    /* Extra padding for very small screens */
    .hero {
        padding-top: 120px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-visual {
        height: 300px;
    }
    
    .code-block.large,
    .code-block.medium {
        width: 180px;
        height: 120px;
    }
    
    .about-content h2 {
        font-size: 2rem;
    }
    
    .about-stats {
        grid-template-columns: 1fr;
    }
    
    .stat h3 {
        font-size: 2rem;
    }
    
    .tech-icon {
        padding: 0.8rem 1.2rem;
        font-size: 0.8rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
}

/* Additional mobile fixes for iOS and problematic devices */
@media screen and (max-device-width: 768px) {
    body {
        background-attachment: scroll !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }
}

/* iOS specific fixes */
@supports (-webkit-overflow-scrolling: touch) {
    body {
        background-attachment: scroll;
    }
}