/* ===========================
   CSS Custom Properties (Variables)
   =========================== */
:root {
    /* Color Palette */
    --color-primary: #007BFF;
    --color-secondary: #64ffda;
    --color-accent: #bb86fc;
    --color-text-primary: #111;
    --color-text-secondary: #333;
    --color-background: #ffffff;
    --color-background-secondary: #f9f9f9;
    --color-background-tertiary: #f5f5f5;
    --color-border: rgba(100, 255, 218, 0.2);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #64ffda, #bb86fc);
    --gradient-secondary: linear-gradient(135deg, #bb86fc, #64ffda);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Font Sizes */
    --font-size-xs: 0.8rem;
    --font-size-sm: 0.9rem;
    --font-size-base: 1rem;
    --font-size-md: 1.1rem;
    --font-size-lg: 1.3rem;
    --font-size-xl: 1.5rem;
    --font-size-2xl: 2.5rem;
    --font-size-3xl: 3.5rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 15px;
    --radius-xl: 50px;

    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-slow: 0.8s ease-out;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 30px rgba(100, 255, 218, 0.3);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--color-text-primary);
    background: var(--color-background);
    min-height: 100vh;
}

html {
    scroll-padding-top: 80px;
    scroll-behavior: smooth;
}

section {
    scroll-margin-top: 80px;
}

/* ===========================
   Navigation
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--color-background);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
}

.logo img {
    height: 60px;
    width: auto;
    max-width: 300px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-menu a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
    font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--color-primary);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: width var(--transition-fast);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
    background: none;
    border: none;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--color-primary);
    margin: 3px 0;
    transition: var(--transition-fast);
    border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Skip Navigation Link (Accessibility) */
.skip-navigation {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-primary);
    color: white;
    padding: var(--spacing-sm);
    text-decoration: none;
    z-index: 2000;
}

.skip-navigation:focus {
    top: 0;
}

/* ===========================
   Main Content
   =========================== */
.main-content {
    margin-top: 80px;
}

.section {
    padding: var(--spacing-lg) 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
    animation: fadeInUp var(--transition-slow);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    text-align: center;
    padding: var(--spacing-xl) 0;
    background: var(--color-background-secondary);
    background-size: cover;
    background-position: center;
}

.hero h1 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.hero .subtitle {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
    color: var(--color-text-secondary);
}

.hero .bio {
    font-size: var(--font-size-md);
    max-width: 600px;
    margin: 0 auto 3rem;
    color: var(--color-text-primary);
}

.cta-button {
    display: inline-block;
    background: var(--gradient-primary);
    color: #0f0f23;
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    border-radius: var(--radius-xl);
    font-weight: bold;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    font-size: var(--font-size-base);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.cta-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===========================
   Section Headers
   =========================== */
.section h2 {
    font-size: var(--font-size-2xl);
    text-align: center;
    margin-bottom: 3rem;
    color: var(--color-primary);
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* ===========================
   About Section
   =========================== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
}

.about-text {
    font-size: var(--font-size-md);
    line-height: 1.8;
}

.about-text h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.about-text p {
    margin-bottom: var(--spacing-sm);
}

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

.skill-category {
    background: var(--color-background-tertiary);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: rgba(100, 255, 218, 0.4);
}

.skill-category h4 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-base);
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    padding: 0.2rem 0;
    color: var(--color-text-primary);
}

/* ===========================
   Services Section
   =========================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.service-card {
    background: var(--color-background-tertiary);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--color-border);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(100, 255, 218, 0.5);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    display: block;
}

.service-card h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 1.4rem;
}

.service-card p {
    margin-bottom: var(--spacing-sm);
}

.service-card ul {
    list-style: none;
    text-align: left;
    margin-top: var(--spacing-sm);
}

.service-card li {
    padding: 0.3rem 0;
    color: var(--color-text-primary);
    position: relative;
    padding-left: var(--spacing-sm);
}

.service-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--color-primary);
}

/* ===========================
   Projects Section
   =========================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-md);
}

.project-card {
    background: var(--color-background-tertiary);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-fast);
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-lg);
}

.project-card p {
    margin-bottom: var(--spacing-sm);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin: var(--spacing-sm) 0;
}

.tag {
    background: var(--color-border);
    color: var(--color-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: var(--font-size-xs);
}

.impact {
    background: #f1f1f1;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
    border-left: 3px solid var(--color-accent);
}

.impact h4 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-xs);
}

/* ===========================
   Testimonials Section
   =========================== */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-md);
}

.testimonial-card {
    background: var(--color-background-tertiary);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(187, 134, 252, 0.2);
    position: relative;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--color-primary);
    opacity: 0.5;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1.5rem;
    font-size: var(--font-size-md);
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.author-info h4 {
    color: var(--color-primary);
    margin-bottom: 0.2rem;
}

.author-info p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* ===========================
   Contact Section
   =========================== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.contact-form {
    background: var(--color-background-tertiary);
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.contact-form h3 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--color-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background: #f8f8f8;
    border: 1px solid rgba(100, 255, 218, 0.3);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(100, 255, 218, 0.2);
}

.form-group .error {
    color: #d32f2f;
    font-size: var(--font-size-sm);
    margin-top: 0.3rem;
    display: none;
}

.form-group input.invalid,
.form-group textarea.invalid,
.form-group select.invalid {
    border-color: #d32f2f;
}

.form-group input.invalid + .error,
.form-group textarea.invalid + .error,
.form-group select.invalid + .error {
    display: block;
}

.contact-info h3 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
    gap: var(--spacing-sm);
}

.contact-item span {
    font-size: 1.2rem;
}

.contact-item a {
    color: var(--color-primary);
    text-decoration: none;
}

.contact-item a:hover {
    text-decoration: underline;
}

.social-links {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.social-links a {
    width: 50px;
    height: 50px;
    background: rgba(100, 255, 218, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    text-decoration: none;
    transition: transform var(--transition-fast), background var(--transition-fast);
    font-size: 1.5rem;
}

.social-links a:hover {
    transform: translateY(-3px);
    background: rgba(100, 255, 218, 0.2);
}

/* ===========================
   Footer
   =========================== */
.footer {
    background: #f0f0f0;
    text-align: center;
    padding: var(--spacing-md) 0;
    border-top: 1px solid var(--color-border);
}

.footer p {
    margin: 0.25rem 0;
}

.footer a {
    color: var(--color-primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===========================
   Loading Spinner
   =========================== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
}

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

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 80px;
        flex-direction: column;
        background-color: var(--color-background);
        width: 100%;
        text-align: center;
        transition: left var(--transition-fast);
        box-shadow: var(--shadow-md);
        padding: var(--spacing-md) 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--color-border);
    }

    .hero h1 {
        font-size: var(--font-size-2xl);
    }

    .hero .subtitle {
        font-size: 1.2rem;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .section {
        padding-left: var(--spacing-sm);
        padding-right: var(--spacing-sm);
    }

    .section h2 {
        font-size: 2rem;
    }

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

    .logo img {
        height: 50px;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero .subtitle {
        font-size: 1rem;
    }

    .section h2 {
        font-size: 1.75rem;
    }

    .cta-button {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* ===========================
   Animations
   =========================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Scrollbar Styling
   =========================== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #eaeaea;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-secondary);
}

/* ===========================
   Focus Indicators (Accessibility)
   =========================== */
*:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    .navbar,
    .mobile-menu-toggle,
    .cta-button {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }

    .section {
        page-break-inside: avoid;
    }
}
