/* Base Styles and CSS Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Screen reader only class for accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus,
.filter-btn:focus,
.nav-link:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(138, 47, 237, 0.1);
}

/* Enhanced focus styles for mobile accessibility */
@media (max-width: 768px) {
    .btn:focus,
    .filter-btn:focus,
    .nav-link:focus,
    input:focus,
    textarea:focus,
    .hamburger:focus,
    .theme-toggle:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 3px;
        box-shadow: 0 0 0 4px rgba(138, 47, 237, 0.2);
        border-radius: 8px;
    }
    
    /* Improve focus visibility for touch devices */
    .btn:focus-visible,
    .filter-btn:focus-visible,
    .nav-link:focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 3px;
        box-shadow: 0 0 0 4px rgba(138, 47, 237, 0.3);
    }
    
    /* Better contrast for accessibility */
    .nav-link:hover,
    .btn:hover,
    .filter-btn:hover {
        filter: brightness(1.1);
    }
    
    /* Improve text contrast */
    .hero-description,
    .about-description,
    .project-description {
        color: var(--text-secondary);
        font-weight: 400;
    }
    
    /* Better button contrast */
    .btn-secondary {
        border-width: 2px;
        font-weight: 600;
    }
    
    /* Improve form accessibility */
    .form-group label {
        font-weight: 500;
        color: var(--text-primary);
    }
    
    .form-group input::placeholder,
    .form-group textarea::placeholder {
        color: var(--text-light);
        opacity: 0.8;
    }
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

:root {
    --primary-color: #8a2fed;
    --primary-dark: #6b1bb8;
    --primary-light: #a855f7;
    --secondary-color: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-light: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--primary-light));
}

/* Dark mode variables */
[data-theme="dark"] {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-dark: #0f172a;
    --border-color: #374151;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    overflow-x: hidden;
}

/* Section Styles */
section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

/* Smooth transitions for better UX */
.btn,
.filter-btn,
.project-card,
.skill-category,
.tech-logo,
.contact-item,
.nav-link,
.social-links a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover,
.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(138, 47, 237, 0.15);
}

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

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.tech-logo:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--bg-secondary);
}

.contact-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.nav-link:hover {
    color: var(--primary-color);
    transform: translateY(-1px);
}

.social-links a:hover {
    transform: translateY(-2px) scale(1.1);
    color: var(--primary-light);
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Body scroll lock for mobile menu */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}
