/* CSS Custom Properties */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --background-color: #ffffff;
    --foreground-color: #0f172a;
    --muted-color: #f8fafc;
    --muted-foreground: #64748b;
    --border-color: #e2e8f0;
    --card-color: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --radius: 0.5rem;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --background-color: #0f172a;
    --foreground-color: #f8fafc;
    --muted-color: #1e293b;
    --muted-foreground: #94a3b8;
    --border-color: #334155;
    --card-color: #1e293b;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--background-color);
    color: var(--foreground-color);
    line-height: 1.6;
    transition: var(--transition);
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #8b5cf6);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 1rem 1.5rem;
    transition: var(--transition);
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px var(--shadow-color);
}

[data-theme="dark"] .navbar.scrolled {
    background-color: rgba(15, 23, 42, 0.95);
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--foreground-color);
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle, .mobile-menu-toggle {
    background: none;
    border: none;
    color: var(--foreground-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.theme-toggle:hover, .mobile-menu-toggle:hover {
    background-color: var(--muted-color);
}

.mobile-menu-toggle {
    display: none;
}

.mobile-menu {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.mobile-link {
    display: block;
    padding: 0.75rem 0;
    text-decoration: none;
    color: var(--foreground-color);
    font-weight: 500;
    transition: var(--transition);
}

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

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 1.5rem;
    padding-top: 6rem;
}

.hero-container {
    max-width: 1200px;
    text-align: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.text-primary {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.typing-text {
    min-height: 1.5rem;
}

.typing-cursor {
    animation: blink 1s infinite;
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.hero-scroll {
    margin-top: 4rem;
    font-size: 1.5rem;
    color: var(--muted-foreground);
    animation: bounce 2s infinite;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* About Section */
.about {
    background-color: var(--card-color);
}

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

.about-image {
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

.profile-image {
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 40px var(--shadow-color);
}

.about-content {
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.4s forwards;
}

.about-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.about-text {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.skills-section {
    margin-bottom: 2rem;
}

.skills-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.skill-badge:hover {
    transform: scale(1.05);
}

.skill-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

[data-theme="dark"] .skill-blue {
    background-color: #1e3a8a;
    color: #93c5fd;
}

.skill-cyan {
    background-color: #cffafe;
    color: #0e7490;
}

[data-theme="dark"] .skill-cyan {
    background-color: #164e63;
    color: #67e8f9;
}

.skill-green {
    background-color: #dcfce7;
    color: #166534;
}

[data-theme="dark"] .skill-green {
    background-color: #14532d;
    color: #86efac;
}

.skill-purple {
    background-color: #f3e8ff;
    color: #7c3aed;
}

[data-theme="dark"] .skill-purple {
    background-color: #581c87;
    color: #c4b5fd;
}

.skill-orange {
    background-color: #fed7aa;
    color: #c2410c;
}

[data-theme="dark"] .skill-orange {
    background-color: #9a3412;
    color: #fdba74;
}

.skill-yellow {
    background-color: #fef3c7;
    color: #a16207;
}

[data-theme="dark"] .skill-yellow {
    background-color: #92400e;
    color: #fcd34d;
}

.skill-gray {
    background-color: #f3f4f6;
    color: #374151;
}

[data-theme="dark"] .skill-gray {
    background-color: #374151;
    color: #d1d5db;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: var(--foreground-color);
    font-size: 1.5rem;
    transition: var(--transition);
}

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

/* Projects Section */
.projects {
    background-color: var(--background-color);
}

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

.project-card {
    background-color: var(--card-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: var(--transition);
    cursor: pointer;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

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

.project-image {
    width: 100%;
    height: 12rem;
    object-fit: cover;
    transition: var(--transition);
}

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

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-description {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.tech-badge {
    padding: 0.25rem 0.75rem;
    background-color: var(--muted-color);
    color: var(--foreground-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.project-link:hover {
    text-decoration: underline;
}

/* Experience Section */
.experience {
    background-color: var(--card-color);
}

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

.timeline::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-color), #8b5cf6);
}

.timeline-item {
    position: relative;
    padding-left: 5rem;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid var(--background-color);
}

.timeline-content {
    background-color: var(--muted-color);
    padding: 1.5rem;
    border-radius: var(--radius);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.timeline-period {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

.timeline-company {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: var(--muted-foreground);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.timeline-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.certifications {
    margin-top: 4rem;
}

.certifications-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
}

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

.certification-card {
    background-color: var(--muted-color);
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.certification-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.certification-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.certification-description {
    color: var(--muted-foreground);
}

/* Contact Section */
.contact {
    background-color: var(--background-color);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.2s forwards;
}

.contact-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.contact-text {
    color: var(--muted-foreground);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--muted-color);
    color: var(--primary-color);
}

.contact-detail-content h4 {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.contact-detail-content p {
    color: var(--muted-foreground);
}

.contact-form-container {
    background-color: var(--card-color);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    opacity: 0;
    animation: fadeInUp 0.6s ease 0.4s forwards;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: var(--background-color);
    color: var(--foreground-color);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
}

/* Footer */
.footer {
    background-color: var(--foreground-color);
    color: var(--background-color);
    padding: 3rem 0;
    text-align: center;
}

.footer-text {
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-link {
    color: var(--muted-foreground);
    font-size: 1.25rem;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--background-color);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-color);
    border-radius: var(--radius);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--muted-foreground);
    cursor: pointer;
    z-index: 1001;
}

.modal-close:hover {
    color: var(--foreground-color);
}

.modal-body {
    padding: 2rem;
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.modal-description {
    color: var(--muted-foreground);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-section {
    margin-bottom: 1.5rem;
}

.modal-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.modal-features {
    list-style: none;
    padding: 0;
}

.modal-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.modal-features li::before {
    content: '✓';
    color: #10b981;
    font-weight: 600;
    margin-top: 0.125rem;
}

.modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background-color: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 10px 30px var(--shadow-color);
    z-index: 1000;
    transform: translateX(100%);
    opacity: 0;
    transition: var(--transition);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast-icon {
    color: #10b981;
    font-size: 1.25rem;
}

.toast-message {
    color: var(--foreground-color);
    font-weight: 500;
}

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

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

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

@keyframes modalSlideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .mobile-menu.show {
        display: flex;
        flex-direction: column;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .profile-image {
        width: 15rem;
        height: 15rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 1rem;
    }
    
    .timeline-item {
        padding-left: 3rem;
    }
    
    .timeline-item::before {
        left: 0.5rem;
    }
    
    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .certifications-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        max-width: 95%;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .toast {
        left: 1rem;
        right: 1rem;
        top: 1rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .about-title {
        font-size: 1.25rem;
    }
    
    .contact-form-container {
        padding: 1.5rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
    }
}