/* ========================================
   RESET & BASE STYLES
   ======================================== */

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

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --dark-color: #1a1a1a;
    --light-color: #f5f5f5;
    --text-color: #333;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* ========================================
   NAVIGATION - MOBILE FIRST
   ======================================== */

.navbar {
    background-color: #fff;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.navbar-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    padding: 0;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: #fff;
    list-style: none;
    flex-direction: column;
    box-shadow: var(--shadow);
    gap: 0;
}

.nav-menu.active {
    display: flex;
}

.nav-menu li {
    border-bottom: 1px solid var(--border-color);
}

.nav-menu li:last-child {
    border-bottom: none;
}

.nav-menu a {
    display: block;
    padding: 1rem;
    color: var(--text-color);
    font-weight: 500;
}

.nav-menu a:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Desktop Navigation */
@media (min-width: 768px) {
    .menu-toggle {
        display: none;
    }

    .nav-menu {
        display: flex !important;
        position: static;
        background-color: transparent;
        box-shadow: none;
        flex-direction: row;
        gap: 2rem;
    }

    .nav-menu li {
        border-bottom: none;
    }

    .nav-menu a {
        padding: 0;
    }

    .nav-menu a:hover {
        background-color: transparent;
        color: var(--primary-color);
        border-bottom: 2px solid var(--primary-color);
        padding-bottom: 5px;
    }
}

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

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 2rem 1rem;
    text-align: center;
}

.hero-content h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1rem;
    opacity: 0.95;
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 1rem;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }
}

/* ========================================
   FILTER SECTION
   ======================================== */

.filter-section {
    padding: 2rem 0;
    background-color: var(--light-color);
}

.filter-section h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    background-color: #fff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

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

@media (min-width: 768px) {
    .filter-section {
        padding: 3rem 0;
    }

    .filter-section h3 {
        font-size: 1.5rem;
    }

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

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

.projects {
    padding: 2rem 0;
    min-height: 100vh;
}

.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Project Card */
.project-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: fadeInUp 0.6s ease;
}

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

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

.project-card.hidden {
    display: none;
}

.project-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
    background-color: var(--light-color);
}

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

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(76, 175, 80, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.view-btn {
    background-color: #fff;
    color: var(--primary-color);
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-weight: 600;
    display: inline-block;
    transition: var(--transition);
}

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

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.project-category {
    display: inline-block;
    font-size: 0.75rem;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.35rem 0.7rem;
    border-radius: 3px;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.project-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

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

.tech-tag {
    display: inline-block;
    background-color: var(--light-color);
    color: var(--text-color);
    padding: 0.35rem 0.7rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: #999;
}

.project-status {
    background-color: #e8f5e9;
    color: var(--primary-color);
    padding: 0.35rem 0.7rem;
    border-radius: 3px;
    font-weight: 600;
}

.no-projects {
    text-align: center;
    padding: 3rem;
    color: #999;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background-color: var(--primary-color);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

.load-more-btn:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .projects {
        padding: 3rem 0;
    }

    .project-card {
        display: flex;
        flex-direction: column;
    }

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

    .load-more-container {
        margin-top: 3rem;
    }
}

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

.about {
    background-color: var(--light-color);
    padding: 2rem 0;
}

.about h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--dark-color);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.about-text p {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: #555;
}

.skills h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.skill-item {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

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

.skill-item p {
    font-weight: 600;
    color: var(--text-color);
}

.contact-cta {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.contact-cta h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.contact-cta p {
    color: #666;
    margin-bottom: 1.5rem;
}

.contact-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

.contact-btn:hover {
    background-color: #45a049;
    transform: scale(1.05);
}

@media (min-width: 768px) {
    .about {
        padding: 3rem 0;
    }

    .about h2 {
        font-size: 2.2rem;
    }

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

    .skills-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .contact-cta {
        padding: 2.5rem;
    }
}

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

.footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 2rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

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

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: #fff;
    opacity: 0.8;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    opacity: 0.7;
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .footer {
        padding: 3rem 0 1rem;
    }

    .footer-content {
        margin-bottom: 2rem;
    }
}

/* ========================================
   MODAL POPUP STYLES
   ======================================== */

.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;
    overflow-y: auto;
}

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

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

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 95%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.close-modal:hover {
    background-color: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
}

.modal-title {
    font-size: 1.8rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 700;
}

.modal-meta {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.95rem;
    color: #666;
}

.modal-year,
.modal-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-year i,
.modal-status i {
    color: var(--primary-color);
}

.modal-description {
    margin-bottom: 2rem;
}

.modal-description h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.modal-description p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
}

.modal-technologies {
    margin-bottom: 2rem;
}

.modal-technologies h3 {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.modal-tech-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color) 0%, #45a049 100%);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(76, 175, 80, 0.2);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    text-align: center;
    border: none;
}

.modal-btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    flex: 1;
    min-width: 150px;
}

.modal-btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.modal-btn-secondary {
    background-color: var(--light-color);
    color: var(--text-color);
    flex: 1;
    min-width: 150px;
}

.modal-btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

/* Mobile Modal Styles */
@media (max-width: 767px) {
    .modal-header {
        height: 200px;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 16px 16px 0 0;
        margin-top: auto;
    }

    .modal.active {
        align-items: flex-end;
    }

    .close-modal {
        top: 10px;
        right: 15px;
    }

    .modal-btn {
        font-size: 0.85rem;
        padding: 0.7rem 1rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-btn-primary,
    .modal-btn-secondary {
        width: 100%;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}

/* ========================================
   UTILITIES & RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 1rem;
    }

    section {
        scroll-margin-top: 70px;
    }
}

/* Smooth scroll for older browsers */
@supports not (scroll-behavior: smooth) {
    html {
        scroll-behavior: auto;
    }
}

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

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

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

.project-card.show {
    animation: fadeInUp 0.6s ease forwards;
}
