/* =====================
   RESET & VARIABLES
   ===================== */

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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Colors */
body.dark-mode {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --secondary: #a855f7;
    --accent: #f97316;
    --text-dark: #f0f0f0;
    --text-light: #b0b0b0;
    --bg-light: #1a1a2e;
    --bg-white: #0f0f1e;
    --border: #2d2d4a;
}

/* Prefers dark mode system preference */
@media (prefers-color-scheme: dark) {
    body:not(.light-mode) {
        --primary: #7c3aed;
        --primary-dark: #6d28d9;
        --secondary: #a855f7;
        --accent: #f97316;
        --text-dark: #f0f0f0;
        --text-light: #b0b0b0;
        --bg-light: #1a1a2e;
        --bg-white: #0f0f1e;
        --border: #2d2d4a;
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background: var(--bg-white);
    line-height: 1.6;
}

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

/* =====================
   NAVBAR
   ===================== */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

body.dark-mode .navbar {
    background: rgba(15, 15, 30, 0.95);
}

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

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: var(--transition);
}

.logo a:hover {
    transform: scale(1.05);
}

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

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after {
    width: 100%;
}

.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.theme-btn:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: var(--shadow-lg);
}

.theme-btn i {
    transition: transform 0.3s ease;
}

.dark-mode .theme-btn i {
    transform: rotate(180deg);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 5px 0;
    border-radius: 3px;
    transition: var(--transition);
}

body.dark-mode .nav-menu.active {
    background: var(--bg-white);
}

/* =====================
   HERO SECTION
   ===================== */

.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    margin-top: 60px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s infinite ease-in-out reverse;
}

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

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.cta-buttons {
    display: flex;
    gap: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-block;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.hero-image {
    display: flex;
    justify-content: center;
    animation: fadeIn 1s ease-out 0.4s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.profile-image {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-xl);
    border: 8px solid var(--bg-white);
    animation: floatImage 6s ease-in-out infinite;
}

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

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    animation: bounce 2s infinite;
}

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

.scroll-indicator span {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid var(--primary);
    border-radius: 13px;
    position: relative;
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.wheel {
    width: 4px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: scroll-wheel 1.5s infinite;
}

@keyframes scroll-wheel {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* =====================
   ABOUT SECTION
   ===================== */

.about {
    padding: 6rem 2rem;
    background: var(--bg-light);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 2px;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

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

.about-text strong {
    color: var(--primary);
    font-weight: 600;
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.skill-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.skill-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.skill-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.skill-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.skill-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* =====================
   PROJECTS SECTION
   ===================== */

.projects {
    padding: 6rem 2rem;
    background: var(--bg-white);
}

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

.project-card {
    background: var(--bg-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.project-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 2rem;
    color: white;
}

.project-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.project-tech {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.project-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    flex: 1;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.project-stars {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.project-stars i {
    color: #fbbf24;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.project-link:hover {
    gap: 0.8rem;
}

.project-link i {
    transition: var(--transition);
}

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

/* =====================
   EXPERIENCE SECTION
   ===================== */

.experience {
    padding: 6rem 2rem;
    background: var(--bg-white);
}

.experience-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
}

.experience-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

.experience-item:nth-child(even) {
    direction: rtl;
}

.experience-item:nth-child(even) > * {
    direction: ltr;
}

.experience-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--bg-white);
    border: 4px solid var(--primary);
    border-radius: 50%;
    top: 0;
    z-index: 10;
}

.experience-content {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.experience-content:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.experience-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.experience-company {
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.3rem;
}

.experience-period {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.experience-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* =====================
   CERTIFICATIONS SECTION
   ===================== */

.certifications {
    padding: 6rem 2rem;
    background: var(--bg-light);
}

.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.cert-card {
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.cert-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.cert-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.cert-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

.cert-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cert-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-dark);
}

.cert-info p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.cert-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    margin-top: auto;
}

.cert-link:hover {
    color: var(--secondary);
    gap: 0.5rem;
}

/* =====================
   STATS SECTION
   ===================== */

.stats {
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

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

.stat-card {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-8px);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1rem;
    opacity: 0.95;
}

/* =====================
   CONTACT SECTION
   ===================== */

.contact {
    padding: 6rem 2rem;
    background: var(--bg-light);
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.contact-method {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: var(--transition);
    text-align: center;
}

.contact-method:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.contact-method i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.contact-method h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.contact-method p {
    font-size: 0.95rem;
    margin: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.contact-method a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.contact-method a:hover {
    color: var(--secondary);
}

/* =====================
   FOOTER
   ===================== */

.footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* =====================
   RESPONSIVE DESIGN
   ===================== */

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .theme-toggle {
        order: -1;
    }

    .nav-menu {
        display: none;
    }

    .nav-menu.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--bg-white);
        padding: 1rem;
        gap: 1rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .cta-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .profile-image {
        width: 200px;
        height: 200px;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

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

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

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .skill-card {
        padding: 1.2rem;
    }

    .skill-card i {
        font-size: 1.5rem;
    }

    .skill-card h3 {
        font-size: 1rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .experience-timeline::before {
        left: 20px;
    }

    .experience-item {
        grid-template-columns: 1fr;
        margin-left: 60px;
    }

    .experience-item:nth-child(even) {
        direction: ltr;
    }

    .experience-marker {
        left: 0;
        transform: translateX(-60px);
    }

    .certifications-grid {
        grid-template-columns: 1fr;
    }

    .contact-methods {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .theme-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

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

    .hero-description {
        font-size: 0.95rem;
    }

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

    .cta-buttons {
        flex-direction: column;
    }

    .about-text p {
        font-size: 1rem;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .stat-card p {
        font-size: 0.9rem;
    }

    .contact-method h3 {
        font-size: 1rem;
    }

    .contact-method i {
        font-size: 2rem;
    }

    .experience-item {
        margin-left: 50px;
    }

    .experience-marker {
        transform: translateX(-55px);
    }

    .experience-timeline::before {
        left: 15px;
    }

    .navbar-container {
        padding: 0.8rem 1.5rem;
    }

    .navbar {
        z-index: 1000;
    }

    .section-title {
        font-size: 1.7rem;
    }
}

/* =====================
   ANIMATIONS
   ===================== */

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

.project-card {
    animation: slideIn 0.6s ease-out;
}

.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(n+4) {
    animation-delay: calc(0.1s * (var(--index) + 1));
}

/* Scroll animations */
.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Navbar scroll effect */
.navbar.scrolled {
    box-shadow: var(--shadow-md);
    background: rgba(255, 255, 255, 0.98);
}
