/* Custom CSS Variables */
:root {
    --primary: #2cb67d;
    --primary-dark: #239a69;
    --bg-dark: #0f0f23;
    --bg-card: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a7a9be;
    --text-muted: #7f8c9b;
    --border: #2d2d44;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-secondary);
    line-height: 1.6;
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-card);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Custom Cursor */
.cursor-dot, .cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
}

.cursor-outline {
    width: 32px;
    height: 32px;
    border: 2px solid var(--primary);
    transition: all 0.3s ease;
}

.cursor-outline.hover {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.3;
}

/* Hero Section */
.hero-bg {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
    position: relative;
    overflow: hidden;
}

.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(44, 182, 125, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(44, 182, 125, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Section Titles */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

/* Profile Image Container */
.profile-image-container {
    position: relative;
    display: flex;
    justify-content: flex-start;
}

/* Profile Image */
.profile-image {
    border: 4px solid var(--primary);
    box-shadow: 0 0 30px rgba(44, 182, 125, 0.3);
    transition: all 0.3s ease;
    transform: translateX(-70px);
    display: block;
    position: relative;
}

.profile-image:hover {
    transform: translateX(-25px) scale(1.05);
    box-shadow: 0 0 40px rgba(44, 182, 125, 0.5);
}

/* Skills Section - Simplified Design */
.skill-item {
    margin-bottom: 1.5rem;
    opacity: 1; /* Always visible */
    transform: translateY(0); /* No transform */
    transition: all 0.3s ease;
}

.skill-item .flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.skill-item .text-lg {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.skill-item .text-sm {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
}

.skill-bar-bg {
    width: 100%;
    background: var(--bg-card);
    border-radius: 9999px;
    height: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.skill-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    height: 100%;
    border-radius: 9999px;
    transition: width 1.5s ease;
    position: relative;
    width: 0%; /* Start at 0% */
}

.skill-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Mobile-specific skill bar improvements */
@media (max-width: 768px) {
    .skill-item {
        margin-bottom: 1.25rem;
        opacity: 1 !important; /* Force visibility on mobile */
        transform: none !important; /* No transform on mobile */
    }
    
    .skill-item .text-lg {
        font-size: 1rem;
    }
    
    .skill-item .text-sm {
        font-size: 0.8rem;
    }
    
    .skill-bar-bg {
        height: 10px;
    }
    
    .skill-bar-fill {
        transition: width 1s ease; /* Faster animation on mobile */
    }
}

@media (max-width: 480px) {
    .skill-item {
        margin-bottom: 1rem;
    }
    
    .skill-item .text-lg {
        font-size: 0.9rem;
    }
    
    .skill-bar-bg {
        height: 8px;
    }
}

/* Project Cards - Enhanced Design */
.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    cursor: pointer;
    height: auto;
    min-height: 320px;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image {
    transform: scale(1.02);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(15, 15, 35, 0.9) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-content {
    position: relative;
    padding: 1.5rem;
    background: var(--bg-card);
    z-index: 2;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tech-tag {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-link:hover {
    color: var(--text-primary);
    transform: translateX(3px);
}

.project-link i {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

.project-link:hover i {
    transform: translateX(2px);
}

.project-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-status.live {
    background: #10b981;
    color: white;
}

.project-status.coming-soon {
    background: #f59e0b;
    color: white;
}

.project-status.current {
    background: var(--primary);
    color: white;
}

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

/* Responsive Design for Projects */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .profile-image {
        max-width: 200px;
        transform: translateX(-10px);
    }
    
    .skill-item {
        margin-bottom: 1rem;
    }
    
    .project-card {
        min-height: 280px;
    }
    
    .project-image {
        height: 160px;
    }
    
    .project-content {
        padding: 1rem;
    }
    
    .project-title {
        font-size: 1.1rem;
    }
    
    .project-description {
        font-size: 0.85rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
    }
    
    .profile-image {
        max-width: 180px;
        transform: translateX(-5px);
    }
    
    .btn-primary {
        padding: 10px 24px;
        font-size: 14px;
    }
    
    .social-link {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .project-card {
        min-height: 260px;
    }
    
    .project-image {
        height: 140px;
    }
    
    .project-content {
        padding: 0.8rem;
    }
    
    .project-title {
        font-size: 1rem;
    }
    
    .project-description {
        font-size: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .tech-tag {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }
    
    .project-link {
        font-size: 0.8rem;
    }
}

/* Project Loading Animation */
.project-card.loading {
    animation: projectPulse 1.5s ease-in-out infinite;
}

@keyframes projectPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
}

/* Project Hover Effects */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(44, 182, 125, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover::before {
    opacity: 1;
}

/* Project Image Overlay Effect */
.project-image-container {
    position: relative;
    overflow: hidden;
}

.project-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.project-card:hover .project-image-container::after {
    transform: translateX(100%);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(44, 182, 125, 0.3);
}

/* Form Inputs */
.form-input {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 182, 125, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Social Links */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(44, 182, 125, 0.3);
}

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

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease forwards;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.8s ease forwards;
}

.animate-fade-in-right {
    animation: fadeInRight 0.8s ease forwards;
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
*:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .cursor-dot, .cursor-outline {
        display: none;
    }
    
    .btn-primary {
        background: var(--primary) !important;
        color: white !important;
    }
}

/* Project Filter Styles (Future Enhancement) */
.project-filter {
    margin-bottom: 2rem;
}

.filter-btn {
    background: var(--bg-card);
    border: 2px solid var(--border);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 5px 15px rgba(44, 182, 125, 0.3);
}

/* Enhanced Project Card Animations */
@keyframes projectCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Project Card Stagger Animation */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

/* Project Image Loading Animation */
.project-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: imageShimmer 1.5s infinite;
    z-index: 1;
}

@keyframes imageShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.project-image.loaded::before {
    display: none;
}

/* Project Status Badge Animation */
@keyframes statusPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Project Link Hover Effect */
.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.project-link:hover::before {
    left: 100%;
}

/* Project Card Focus States */
.project-card:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Project Card Loading State */
.project-card.loading {
    pointer-events: none;
}

.project-card.loading .project-image {
    filter: blur(2px);
}

.project-card.loading .project-content {
    opacity: 0.5;
}

/* Project Grid Responsive Improvements */
@media (min-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        margin-bottom: 0.5rem;
    }
}

/* --- Performance Optimizations --- */
* {
    box-sizing: border-box;
}

/* Optimize animations for mobile */
@media (max-width: 768px) {
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.3s !important;
    }
    
    /* Reduce motion for better performance */
    .project-card,
    .skill-item,
    .hero-content {
        will-change: auto;
    }
    
    /* Optimize transforms */
    .project-card:hover {
        transform: translateY(-5px) !important;
    }
    
    /* Reduce shadow complexity on mobile */
    .project-card {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    }
    
    .project-card:hover {
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15) !important;
    }
}

/* Hardware acceleration for smooth animations */
.hero-content,
.project-card,
.skill-item,
.btn-primary,
.social-link {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Optimize images */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Reduce repaints */
.project-card,
.skill-item {
    contain: layout style paint;
}
