/* Modern Portfolio CSS - Muhammad Lamhamdi */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f8fafc;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --border-radius: 0.75rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Import Modern Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    line-height: 1.7;
    color: var(--gray-700);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 20px;
    border: 2px solid var(--gray-100);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
}

/* Selection Styles */
::selection {
    background: var(--primary-color);
    color: var(--white);
}

::-moz-selection {
    background: var(--primary-color);
    color: var(--white);
}

/* Navigation Styles */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    animation: slideDown 0.8s ease-out;
}

@supports not (backdrop-filter: blur(20px)) {
    nav {
        background: rgba(255, 255, 255, 0.95);
    }
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: var(--transition);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    position: relative;
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Mobile Menu */
.mobile-menu-container {
    display: none;
}

.mobile-menu-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.mobile-menu-button:hover {
    background: var(--gray-100);
    transform: scale(1.1);
}

.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mobile-menu:not(.hidden) {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    color: var(--gray-700);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
}

.mobile-menu a:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    transform: translateX(10px);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(37, 99, 235, 0.05) 0%, 
        rgba(139, 92, 246, 0.05) 50%, 
        rgba(6, 182, 212, 0.05) 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem 1rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

.hero-container {
    max-width: 1280px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 2;
}

.profile-image-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.profile-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(-45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(-45deg); }
    100% { transform: translateX(100%) rotate(-45deg); }
}

.profile-image:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-2xl), 0 0 50px rgba(37, 99, 235, 0.3);
}

/* Typography */
.text-4xl {
    font-size: 2.25rem;
    line-height: 1.2;
}

.text-6xl {
    font-size: 3.75rem;
    line-height: 1.1;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-gray-900 {
    color: var(--gray-900);
}

.text-gray-700 {
    color: var(--gray-700);
}

.text-gray-600 {
    color: var(--gray-600);
}

.text-blue-600 {
    color: var(--primary-color);
}

.text-white {
    color: var(--white);
}

/* Layout */
.max-w-3xl {
    max-width: 48rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-7xl {
    max-width: 80rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mb-12 {
    margin-bottom: 3rem;
}

.mb-16 {
    margin-bottom: 4rem;
}

.leading-relaxed {
    line-height: 1.625;
}

/* Buttons */
.bg-blue-600 {
    background-color: var(--primary-color);
}

.hover\:bg-blue-700:hover {
    background-color: var(--primary-dark);
}

.border-2 {
    border-width: 2px;
}

.border-blue-600 {
    border-color: var(--primary-color);
}

.px-8 {
    padding-left: 2rem;
    padding-right: 2rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.rounded-lg {
    border-radius: var(--border-radius);
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

.transition-all {
    transition: var(--transition);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.hover\:shadow-xl:hover {
    box-shadow: var(--shadow-xl);
}

.transform {
    transform: translateZ(0);
}

.hover\:-translate-y-1:hover {
    transform: translateY(-0.25rem);
}

/* Flex */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-row {
    flex-direction: row;
}

.gap-4 {
    gap: 1rem;
}

.justify-center {
    justify-content: center;
}

.items-center {
    align-items: center;
}

/* Grid */
.grid {
    display: grid;
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.gap-12 {
    gap: 3rem;
}

/* Sections */
section {
    position: relative;
}

.bg-white {
    background-color: var(--white);
}

.bg-gray-50 {
    background-color: var(--gray-50);
}

/* About Section */
#about {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(248, 250, 252, 1) 100%);
}

.w-24 {
    width: 6rem;
}

.h-1 {
    height: 0.25rem;
}

.bg-blue-600 {
    background-color: var(--primary-color);
}

/* Skills Tags */
.bg-blue-100 {
    background-color: rgba(37, 99, 235, 0.1);
}

.text-blue-800 {
    color: #1e40af;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.rounded-full {
    border-radius: 9999px;
}

.text-sm {
    font-size: 0.875rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 0.5rem;
}

/* Stats Cards */
.text-center {
    text-align: center;
}

.p-6 {
    padding: 1.5rem;
}

.bg-gradient-to-br {
    background-image: linear-gradient(to bottom right, var(--color-from), var(--color-to));
}

.from-blue-50 {
    --color-from: #eff6ff;
}

.to-indigo-100 {
    --color-to: #e0e7ff;
}

.from-green-50 {
    --color-from: #f0fdf4;
}

.to-emerald-100 {
    --color-to: #dcfce7;
}

.from-purple-50 {
    --color-from: #faf5ff;
}

.to-violet-100 {
    --color-to: #ede9fe;
}

.from-orange-50 {
    --color-from: #fff7ed;
}

.to-amber-100 {
    --color-to: #fef3c7;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.text-3xl {
    font-size: 1.875rem;
}

.text-blue-600 {
    color: var(--primary-color);
}

.text-green-600 {
    color: var(--success-color);
}

.text-purple-600 {
    color: var(--secondary-color);
}

.text-orange-600 {
    color: var(--warning-color);
}

/* Projects Section */
#projects {
    background: var(--gray-50);
}

.project-card {
    transition: var(--transition);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, transparent, rgba(37, 99, 235, 0.02));
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    z-index: -1;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-2xl);
}

.h-48 {
    height: 12rem;
}

.text-6xl {
    font-size: 3.75rem;
}

.from-green-400 {
    --color-from: #4ade80;
}

.to-blue-500 {
    --color-to: #3b82f6;
}

.from-purple-400 {
    --color-from: #a855f7;
}

.to-pink-500 {
    --color-to: #ec4899;
}

.from-indigo-400 {
    --color-from: #818cf8;
}

.to-cyan-500 {
    --color-to: #06b6d4;
}

.from-orange-400 {
    --color-from: #fb923c;
}

.to-red-500 {
    --color-to: #ef4444;
}

.overflow-hidden {
    overflow: hidden;
}

.hover\:shadow-2xl:hover {
    box-shadow: var(--shadow-2xl);
}

/* Tags */
.bg-green-100 {
    background-color: rgba(16, 185, 129, 0.1);
}

.text-green-800 {
    color: #065f46;
}

.bg-purple-100 {
    background-color: rgba(139, 92, 246, 0.1);
}

.text-purple-800 {
    color: #581c87;
}

.bg-pink-100 {
    background-color: rgba(236, 72, 153, 0.1);
}

.text-pink-800 {
    color: #9d174d;
}

.bg-indigo-100 {
    background-color: rgba(129, 140, 248, 0.1);
}

.text-indigo-800 {
    color: #3730a3;
}

.bg-cyan-100 {
    background-color: rgba(6, 182, 212, 0.1);
}

.text-cyan-800 {
    color: #155e75;
}

.bg-orange-100 {
    background-color: rgba(251, 146, 60, 0.1);
}

.text-orange-800 {
    color: #9a3412;
}

.bg-red-100 {
    background-color: rgba(239, 68, 68, 0.1);
}

.text-red-800 {
    color: #991b1b;
}

.rounded {
    border-radius: 0.25rem;
}

.text-xs {
    font-size: 0.75rem;
}

.space-x-2 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 0.5rem;
}

.justify-between {
    justify-content: space-between;
}

.hover\:text-blue-800:hover {
    color: #1e40af;
}

.ml-1 {
    margin-left: 0.25rem;
}

/* Contact Section */
#contact {
    background: var(--white);
}

.w-12 {
    width: 3rem;
}

.h-12 {
    height: 3rem;
}

.bg-blue-100 {
    background-color: rgba(37, 99, 235, 0.1);
}

.mr-4 {
    margin-right: 1rem;
}

.space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem;
}

.mt-8 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.space-x-4 > :not([hidden]) ~ :not([hidden]) {
    margin-left: 1rem;
}

.w-10 {
    width: 2.5rem;
}

.h-10 {
    height: 2.5rem;
}

.bg-gray-800 {
    background-color: var(--gray-800);
}

.hover\:bg-gray-900:hover {
    background-color: var(--gray-900);
}

.bg-blue-400 {
    background-color: #60a5fa;
}

.hover\:bg-blue-500:hover {
    background-color: #3b82f6;
}

/* Form Styles */
.bg-gray-50 {
    background-color: var(--gray-50);
}

.p-8 {
    padding: 2rem;
}

.block {
    display: block;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.w-full {
    width: 100%;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.border {
    border-width: 1px;
}

.border-gray-300 {
    border-color: var(--gray-300);
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5);
}

.focus\:ring-blue-500:focus {
    --ring-color: rgba(37, 99, 235, 0.5);
}

.focus\:border-transparent:focus {
    border-color: transparent;
}

.resize-none {
    resize: none;
}

.mr-2 {
    margin-right: 0.5rem;
}

/* Alert Styles */
.border-green-400 {
    border-color: #4ade80;
}

.text-green-700 {
    color: #15803d;
}

.border-red-400 {
    border-color: #f87171;
}

.text-red-700 {
    color: #b91c1c;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--white);
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.text-gray-400 {
    color: var(--gray-400);
}

.text-gray-500 {
    color: var(--gray-500);
}

.text-12 {
    font-size: 0.75rem;
}

/* Animations */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Responsive Design */
@media (min-width: 640px) {
    .sm\:px-6 {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .sm\:flex-row {
        flex-direction: row;
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .md\:text-4xl {
        font-size: 2.25rem;
    }
    
    .md\:text-6xl {
        font-size: 3.75rem;
    }
    
    .md\:text-2xl {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .lg\:px-8 {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-container {
        display: block;
    }
    
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-6xl {
        font-size: 2.5rem;
    }
    
    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .project-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
}

/* Advanced Hover Effects */
.project-card {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.6s;
    pointer-events: none;
    z-index: -1;
}

.project-card:hover::after {
    transform: translateX(100%) rotate(45deg);
}

/* Glassmorphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Project link styles */
.project-card .text-blue-600 {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.project-card .text-blue-600:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

.project-card .fa-external-link-alt {
    font-size: 0.875rem;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.project-card .text-blue-600:hover .fa-external-link-alt {
    transform: translate(2px, -2px);
}

/* Ensure Font Awesome icons are properly aligned */
.fas {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}