:root {
    --bg: #f4f6f8;
    --text: #1f2937;
    --card: #ffffff;
    --primary: #2563eb;
    --accent: #22c55e;
    --sidebar: #0f172a;
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.15);
}

body.dark {
    --bg: #1e2435;
    --text: #e5e7eb;
    --card: #111827;
    --shadow: 0 10px 30px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    transition: background 0.3s ease, color 0.3s ease;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    width: 230px;
    height: 100vh;
    background: var(--sidebar);
    padding: 30px 20px;
    z-index: 1000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.logo {
    color: var(--primary);
    text-align: center;
    margin-bottom: 40px;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar ul {
    list-style: none;
    flex-grow: 1;
}

.sidebar ul li {
    margin-bottom: 8px;
}

.sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #cbd5f5;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    transform: translateX(5px);
}

.sidebar a.active {
    background: rgba(37, 99, 235, 0.2);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(147, 197, 253, 0.3);
    color: #93c5fd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    font-weight: 600;
}

.theme-toggle-btn:hover {
    background: rgba(147, 197, 253, 0.2);
    border-color: #93c5fd;
    transform: scale(1.05);
}

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

body.dark .theme-toggle-btn i::before {
    content: '\f185';
}

.cv-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), #1e40af);
    color: white;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 600;
}

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

/* BUTTONS */
#menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    z-index: 1100;
    background: var(--card);
    color: var(--text);
    transition: all 0.3s ease;
    font-size: 1.2rem;
    box-shadow: var(--shadow);
    display: none;
}

#menu-toggle:hover {
    transform: scale(1.1);
}

/* HERO */
.hero {
    margin-left: 230px;
    height: 75vh;
    background: url("ma_photo.jpeg") center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.animated-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(34,197,94,0.1));
    animation: gradient 8s ease infinite;
    z-index: 0;
}

@keyframes gradient {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

.overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 12, 12, 0.65);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 800px;
    padding: 20px;
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-weight: 700;
    animation: fadeInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 30px;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.typing-text::after {
    content: '';
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 50% { content: '|'; }
    51%, 100% { content: ''; }
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.btn {
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #1e40af);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(37,99,235,0.4);
}

.btn-secondary {
    background: transparent;
    border: 2px solid white;
    color: white;
}

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

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    animation: bounce 2s infinite;
}

.scroll-indicator i {
    font-size: 1.5rem;
    color: white;
}

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

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

/* CONTAINER */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* SECTIONS */
.section {
    margin-left: 230px;
    padding: 80px 20px;
    position: relative;
}

.section.alt {
    background: var(--card);
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 50px;
    color: var(--primary);
    position: relative;
    padding-bottom: 15px;
}

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

/* ABOUT */
.about-intro {
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.8;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.highlight {
    background: var(--bg);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    gap: 15px;
    transition: all 0.3s ease;
}

.highlight:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.highlight i {
    font-size: 2rem;
    color: var(--primary);
    flex-shrink: 0;
}

.highlight h4 {
    margin-bottom: 5px;
    color: var(--primary);
}

/* EXPERIENCE - TIMELINE */
.timeline {
    position: relative;
    padding: 20px 0;
}

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

.timeline-item {
    margin-bottom: 40px;
    padding-left: 80px;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.timeline-item:nth-child(2) { animation-delay: 0.2s; }

.timeline-marker {
    position: absolute;
    left: 15px;
    top: 0;
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
    border: 4px solid var(--bg);
}

.timeline-content h3 {
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 1.2rem;
}

.timeline-date {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

/* SKILLS */
.skills-category {
    background: var(--bg);
    padding: 30px;
    border-radius: 12px;
}

.skills-category h3 {
    margin-bottom: 25px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill {
    margin-bottom: 25px;
}

.skill strong {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.progress-bar {
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    height: 8px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0;
    transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 20px;
}

/* PROJECTS */
.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid var(--primary);
    background: transparent;
    color: var(--primary);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
}

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

.project-card {
    background: var(--card);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-image i {
    font-size: 4rem;
    color: white;
    opacity: 0.8;
}

.project-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.project-content p {
    font-size: 0.95rem;
    margin-bottom: 15px;
    flex-grow: 1;
    color: #6b7280;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.tag {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn-project {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-project:hover {
    transform: translateX(5px);
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.stat-card {
    background: var(--card);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.3s; }

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-card p {
    font-size: 1rem;
    color: #6b7280;
}

/* GITHUB SECTION */
.github-wrapper {
    display: grid;
    gap: 30px;
}

.github-profile {
    display: flex;
    justify-content: center;
}

.github-card {
    background: var(--card);
    padding: 40px;
    border-radius: 14px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 350px;
    transition: all 0.3s ease;
}

.github-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.github-card i {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
}

.github-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.github-card p {
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.6;
}

.github-stats,
.github-projects {
    background: var(--card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.github-stats h3,
.github-projects h3 {
    margin-bottom: 25px;
    color: var(--primary);
    font-size: 1.3rem;
}

.stats-mini {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.stat-mini:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-mini i {
    font-size: 1.8rem;
    color: var(--primary);
    flex-shrink: 0;
}

.stat-label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 3px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.mini-projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.mini-project-card {
    background: var(--bg);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.mini-project-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.project-header i {
    color: var(--primary);
    font-size: 1.2rem;
}

.project-header a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-header a:hover {
    color: var(--accent);
}

.mini-project-card p {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.project-meta {
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: #6b7280;
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-meta i {
    color: var(--primary);
}

/* CERTIFICATIONS */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.cert-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    gap: 20px;
    padding: 25px;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.cert-card:nth-child(2) { animation-delay: 0.1s; }
.cert-card:nth-child(3) { animation-delay: 0.2s; }
.cert-card:nth-child(4) { animation-delay: 0.3s; }
.cert-card:nth-child(5) { animation-delay: 0.4s; }
.cert-card:nth-child(6) { animation-delay: 0.5s; }

.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.cert-badge {
    width: 80px;
    height: 80px;
    min-width: 80px;
    background: linear-gradient(135deg, var(--primary), #1e40af);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.cert-content {
    flex-grow: 1;
}

.cert-content h3 {
    margin-bottom: 5px;
    color: var(--primary);
    font-size: 1.1rem;
}

.cert-issuer {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 3px;
}

.cert-date {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: 600;
}

.cert-description {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
}

.cert-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.cert-link:hover {
    gap: 8px;
    color: var(--accent);
}

/* CONTACT */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.contact-info > p {
    margin-bottom: 25px;
    color: #6b7280;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.contact-item .label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 2px;
}

.contact-form {
    background: var(--bg);
    padding: 30px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.contact-form input,
.contact-form textarea {
    padding: 14px;
    border-radius: 8px;
    border: 2px solid #e5e7eb;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: var(--card);
    color: var(--text);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.contact-form input.error,
.contact-form textarea.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.contact-form input.error:focus,
.contact-form textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.contact-form textarea {
    resize: vertical;
}

/* FOOTER */
.footer {
    margin-left: 230px;
    padding: 40px 20px;
    text-align: center;
    background: #020617;
    color: white;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-socials a {
    color: #93c5fd;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    display: inline-flex;
    width: 45px;
    height: 45px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(147, 197, 253, 0.1);
}

.footer-socials a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.footer-text {
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer-text i {
    color: #ef4444;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--card);
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 80%;
    max-width: 600px;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text);
}

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

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

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

/* ANIMATIONS ON SCROLL */
.animate-on-scroll {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-on-scroll:nth-child(2) { animation-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { animation-delay: 0.2s; }
.animate-on-scroll:nth-child(4) { animation-delay: 0.3s; }

/* MOBILE */
@media (max-width: 900px) {
    #menu-toggle {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
        transform: translateX(-100%);
        position: absolute;
        max-height: 100vh;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .hero,
    .section,
    .footer {
        margin-left: 0;
    }

    .hero {
        height: 60vh;
        margin-top: 60px;
    }

    .hero-text h1 {
        font-size: 2.5rem;
    }

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

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

    .btn {
        width: 100%;
    }

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

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

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

@media (max-width: 600px) {
    .hero-text h1 {
        font-size: 2rem;
    }

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

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}
