 :root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    --accent: #06b6d4;
    --light: #f8fafc;
    --gray: #64748b;
    --gray-light: #e2e8f0;
    --success: #10b981;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    
    /* Background and text defaults (light mode) */
    --bg-color: #ffffff;
    --bg-secondary: #f1f5f9;
    --text-color: #0f172a;
    --text-secondary: #475569;
    --card-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.95);
    --border-color: #e2e8f0;
    --code-bg: #0f172a;
}

/* Dark mode variables */
.dark-mode {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #e2e8f0;
    --accent: #22d3ee;
    --light: #0f172a;
    --gray: #94a3b8;
    --gray-light: #334155;
    --success: #34d399;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    
    --bg-color: #0f172a;
    --bg-secondary: #1e293b;
    --text-color: #f1f5f9;
    --text-secondary: #cbd5e1;
    --card-bg: #1e293b;
    --header-bg: rgba(15, 23, 42, 0.95);
    --border-color: #334155;
    --code-bg: #1e293b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    transition: var(--transition);
}

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
    transition: var(--transition);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    color: var(--text-color);
}

.section-title::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--accent);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

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

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

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

header.scrolled {
    padding: 10px 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 58px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
}

.nav-links li {
    margin-left: 2rem;
}

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

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

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    bottom: -5px;
    left: 0;
    transition: var(--transition);
}

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

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: 1rem;
}

.theme-toggle:hover {
    background-color: var(--gray-light);
}

.theme-toggle i {
    transition: var(--transition);
}

.dark-mode .theme-toggle i.fa-sun {
    display: block;
}

.dark-mode .theme-toggle i.fa-moon {
    display: none;
}

.theme-toggle i.fa-sun {
    display: none;
}

.theme-toggle i.fa-moon {
    display: block;
}

/* Hero Section */
.hero {
    padding-top: 150px;
    padding-bottom: 100px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-color) 100%);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-text {
    flex: 1;
    max-width: 600px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background-color: rgba(37, 99, 235, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.hero-text h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.code-container {
    width: 350px;
    height: 300px;
    background-color: var(--code-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.code-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.code-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red {
    background-color: #ff5f56;
}

.dot.yellow {
    background-color: #ffbd2e;
}

.dot.green {
    background-color: #27ca3f;
}

.code-body {
    font-family: 'Roboto Mono', monospace;
    color: var(--light);
    font-size: 0.9rem;
}

.code-line {
    margin-bottom: 8px;
    opacity: 0;
    animation: fadeInLine 0.5s forwards;
}

.code-line:nth-child(1) { animation-delay: 0.2s; }
.code-line:nth-child(2) { animation-delay: 0.4s; }
.code-line:nth-child(3) { animation-delay: 0.6s; }
.code-line:nth-child(4) { animation-delay: 0.8s; }
.code-line:nth-child(5) { animation-delay: 1s; }
.code-line:nth-child(6) { animation-delay: 1.2s; }
.code-line:nth-child(7) { animation-delay: 1.4s; }

@keyframes fadeInLine {
    to { opacity: 1; }
}

.code-keyword {
    color: #ff79c6;
}

.code-function {
    color: #50fa7b;
}

.code-string {
    color: #f1fa8c;
}

.code-comment {
    color: #6272a4;
}

/* About Section */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-image {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
}

.about-image img {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.about-text {
    flex: 1;
}

.about-kicker {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
}

.about-text h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.about-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    margin-top: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 2rem;
}

.skill {
    background-color: var(--card-bg);
    padding: 8px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

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

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

.skill-ai {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(6, 182, 212, 0.08));
}

.skill-ai i {
    color: var(--accent);
}

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

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: -2rem auto 3rem;
}

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

.project-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(40px);
}

.project-card.animate {
    opacity: 1;
    transform: translateY(0);
}

.project-card:nth-child(2) { transition-delay: 0.15s; }
.project-card:nth-child(3) { transition-delay: 0.3s; }

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

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

.project-img::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    top: -45px;
    right: -40px;
}

.project-img::after {
    content: '';
    position: absolute;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    bottom: -25px;
    left: -15px;
}

.project-logo-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 10px;
    padding: 10px 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.project-card:hover .project-logo-wrap {
    transform: scale(1.06);
}

.project-logo {
    display: block;
    max-width: 130px;
    max-height: 36px;
    object-fit: contain;
}

.project-img-housing {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.project-img-miposh {
    background: linear-gradient(135deg, var(--accent) 0%, var(--success) 100%);
}

.project-img-invoice {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
}

.project-icon {
    position: relative;
    z-index: 1;
    font-size: 2.4rem;
    color: rgba(255, 255, 255, 0.9);
    transition: transform 0.3s ease;
}

.project-card:hover .project-icon {
    transform: scale(1.12) rotate(-4deg);
}

.project-badge {
    position: absolute;
    z-index: 1;
    top: 15px;
    left: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
}

.badge-live::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #4ade80;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
    70% { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.badge-app i {
    font-size: 0.85rem;
}

.project-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px;
}

.project-info h3 {
    font-size: 1.35rem;
    margin-bottom: 6px;
    color: var(--text-color);
}

.project-info p {
    flex: 1;
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.tech-tag {
    background-color: var(--gray-light);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-color);
}

.project-info .btn {
    align-self: flex-start;
}

.project-info .btn i {
    margin-left: 6px;
    font-size: 0.8rem;
}

/* Contact Section */
.contact-content {
    display: flex;
    gap: 50px;
}

.contact-info {
    flex: 1;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.contact-info p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

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

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

.contact-item i {
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.contact-form {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    background-color: var(--card-bg);
    color: var(--text-color);
}

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

/* Footer */
footer {
    background-color: var(--secondary);
    color: white;
    padding: 40px 0 20px;
    transition: var(--transition);
}

.dark-mode footer {
    background-color: #1e293b;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.social-links {
    display: flex;
    gap: 20px;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--accent);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text {
        margin-bottom: 50px;
    }
    
    .about-content {
        flex-direction: column;
    }
    
    .contact-content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .logo img {
        height: 46px;
    }

    .nav-links li {
        margin-left: 0.8rem;
    }

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

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

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

    .about-stats {
        gap: 20px;
    }

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

    .code-container {
        width: 100%;
        max-width: 350px;
    }
}

@media (max-width: 576px) {
    .container {
        width: 92%;
        padding: 0 15px;
    }

    .logo img {
        height: 38px;
    }

    .nav-links li {
        margin-left: 0.5rem;
    }

    .nav-links .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .hero {
        padding-top: 120px;
    }

    .hero-badge {
        font-size: 0.75rem;
        text-align: center;
    }

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

    .hero-text h2 {
        font-size: 1.4rem;
    }

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

    .hero-btns {
        flex-direction: column;
        align-items: center;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 280px;
        margin-bottom: 10px;
    }

    .theme-toggle {
        margin-left: 0.5rem;
    }

    .about-text h3 {
        font-size: 1.5rem;
    }

    .about-stats {
        justify-content: space-between;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .skills-container {
        gap: 10px;
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin: -1.5rem auto 2rem;
    }

    .project-logo {
        max-width: 110px;
    }

    .contact-item {
        gap: 10px;
    }

    .contact-item i {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .modal-box {
        padding: 30px 20px;
    }
}

/* Contact Form Feedback Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(15, 23, 42, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    position: relative;
    width: 90%;
    max-width: 400px;
    padding: 40px 35px;
    text-align: center;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow: var(--shadow);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-box {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    border: none;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
}

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

.modal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.modal-icon.success {
    color: var(--success);
}

.modal-icon.error {
    color: #ef4444;
}

.modal-box h3 {
    margin-bottom: 10px;
    font-size: 1.4rem;
    color: var(--text-color);
}

.modal-box p {
    color: var(--text-secondary);
}
