/* ===========================
   Base Styles (Global)
=========================== */
body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8fafc;
    color: #1f2937;
    font-size: 20px;
    text-align: center;
}

header {
    padding: 2rem;
    background-color: #1e293b;
    color: #fff;
}

h1, h2 {
    margin-bottom: 1rem;
    font-size: 2.8rem;
}

p {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

a {
    text-decoration: none;
    color: #1e293b;
}
a:hover {
    text-decoration: underline;
    color: #38bdf8;
}

/* ===========================
   Navbar Styles (CLEAN)
=========================== */
.main-header {
  background: #1e293b;
  padding: 0;               /* override the generic header padding */
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 150px;             /* fixed, tidy header height */
  padding: 0 16px;
  position: relative;       /* needed for absolute mobile nav */
}
.logo {
  display: flex;
  align-items: center; /* vertically centers the img inside */
  height: 100%;        /* take full height of header */
}
/* Logo */
.logo img {
  position: relative;
  top: 0px;
  height: 40px;             /* make the logo smaller */
  width: auto;
  display: block;
  margin: 0; 
  padding: 0;
}

/* Desktop nav (default) */
nav {
  display: block;
}

nav ul {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav li {
  position: relative;
}

nav a {
  color: #fff;
  font-weight: 600;
  padding: 0 12px;
  line-height: 64px;        /* vertically center in the header */
  display: block;
  transition: color 0.2s ease;
  font-size: 1.05rem;
}

nav a:hover {
  color: #38bdf8;
}

/* Desktop dropdown */
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;                /* sit directly under the parent link */
  left: 0;
  background: #1e293b;
  min-width: 240px;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  overflow: hidden;
  z-index: 10;
}

.dropdown-content a {
  line-height: 1.2;
  padding: 12px 14px;
}

.dropdown:hover .dropdown-content {
  display: block;           /* hover opens on desktop */
}

nav li.dropdown:hover > a {
  color: #38bdf8;
}

/* Burger (hidden on desktop) */
.burger {
  width: 30px;
  height: 22px;
  display: none;            /* only visible on mobile */
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 1001;
}

.burger span {
  display: block;
  height: 3px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: all 0.25s ease;
}

/* Animate burger to X */
.burger.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.burger.active span:nth-child(2) {
  opacity: 0;
}
.burger.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile (<=768px) */
@media (max-width: 768px) {
  /* Show burger and reorder: burger left, logo next, then nav */
  .burger { 
    display: flex; 
    order: 1; 
  }
  .logo   { 
    order: 2; 
  }
  nav     { 
    order: 3; 
  }

  /* Collapse nav under header, hidden by default */
  nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: #1e293b;
    padding: 8px 0;
    text-align: left;
  }
  
  nav.active {
    display: block;         /* JS toggles this */
  }

  nav ul {
    flex-direction: column;
    gap: 0;
  }

  nav a {
    line-height: 1.2;
    padding: 14px 18px;
  }
  
/* Mobile dropdown styles - always expanded */
.dropdown-content {
  display: block !important;   /* always visible on mobile */
  position: static;
  width: 100%;
  background-color: #0f172a;
  padding-left: 16px; /* indent to show hierarchy */
}

.dropdown > a::after {
  content: ""; /* no arrows on mobile */
}
}
/* ===========================
   Home Page Styles
=========================== */
.portfolio-layout {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    flex-direction: column;
}

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

.profile-img-large {
    width: 100%;
    max-width: 400px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: block;
}

.profile-right {
    text-align: center;
}

.profile-desc {
    font-size: 1.4rem;
    color: #1f2937;
    margin-bottom: 20px;
}

.role-title {
    font-size: 1.5rem;
    color: #1f2937;
    font-weight: bold;
}
.logo img {
    height: 50px;
    width: auto;
    position: block;
}


@media (min-width: 769px) {
    .portfolio-layout {
        flex-direction: row;
    }
    .profile-right {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .profile-img-large {
        max-width: 250px;
    }
    .profile-desc {
        font-size: 1.1rem;
    }
    .role-title {
        font-size: 1.2rem;
    }
}

/* ===========================
   Experience Page Styles
=========================== */
.experience-narrative {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.experience-narrative:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.experience-narrative p {
    font-size: 1.3rem;
    color: #1f2937;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .experience-narrative {
        padding: 15px;
        margin: 0 10px 30px;
    }
    .experience-narrative p {
        font-size: 1.1rem;
    }
}

/* ===========================
   Certificates Page Styles
=========================== */
.page-title {
    font-size: 2.8rem;
    margin: 40px 0;
    color: #fff;
}

.certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.certificate-item {
    background: #1f1f1f;
    border-radius: 10px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.certificate-item:hover {
    transform: scale(1.05);
}

.certificate-item img {
    width: 100%;
    height: auto;
    border-bottom: 2px solid #444;
}

.certificate-item p {
    padding: 10px;
    color: #bbb;
    font-size: 1.3rem;
}

/* Certificate Grid Mobile Styles */
@media (max-width: 768px) {
    .certificate-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    .certificate-item {
        margin-bottom: 15px;
    }

    .certificate-item img {
        height: 180px;
        object-fit: contain;
        background: #f5f5f5;
    }

    /* Modal Styles for Mobile */
    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.95);
        z-index: 1000;
        align-items: center;
        justify-content: center;
        padding: 20px;
        box-sizing: border-box;
        animation: modalFadeIn 0.3s ease-out;
    }

    .modal-content {
        max-width: 100%;
        max-height: 70vh;
        width: auto;
        height: auto;
        border-radius: 8px;
    }

    .modal-caption {
        color: white;
        text-align: center;
        margin-top: 15px;
        font-size: 1rem;
    }

    .close {
        position: fixed;
        top: 20px;
        right: 20px;
        color: white;
        font-size: 30px;
        z-index: 1001;
    }

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

/* ===========================
   Contact Page Styles
=========================== */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

.content h1 {
    font-size: 2.8rem;
    margin-bottom: 30px;
    color: #1f2937;
}

#contact-form {
    background: #ffffff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    text-align: left;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #1f2937;
    font-size: 1.3rem;
}

input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1.3rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
textarea:focus {
    border-color: #1e293b;
    outline: none;
    box-shadow: 0 0 8px rgba(30, 41, 59, 0.3);
}

textarea {
    resize: none;
}

.submit-btn {
    display: inline-block;
    background: #1e293b;
    color: #fff;
    font-size: 1.3rem;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.submit-btn:hover {
    background: #0f172a;
    transform: scale(1.03);
}

.contact-info {
    text-align: center;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.05);
}

.contact-info p {
    margin: 8px 0;
    font-size: 1.3rem;
}

.contact-info a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
}

.contact-info a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        margin: 20px auto;
        padding: 10px;
    }
    .content h1 {
        font-size: 2.2rem;
    }
    label {
        font-size: 1.1rem;
    }
    input[type="text"],
    input[type="email"],
    textarea {
        font-size: 1.1rem;
    }
    .submit-btn {
        font-size: 1.1rem;
    }
    .contact-info p {
        font-size: 1.1rem;
    }
}

/* ===========================
   Expertise Pages Styles
=========================== */
.content h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
    color: #1f2937;
}

.content p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto 30px;
    color: #1f2937;
}

.card-grid {
    display: grid;
    gap: 20px;
    padding: 0 15px;
    margin: 0 auto;
    max-width: 1200px;
}

@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

.card {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card h2 a {
    text-decoration: none;
    font-size: 1.5rem;
    color: #1f2937;
}

.card p {
    color: #555;
    margin-top: 10px;
    font-size: 1.3rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.skills span {
    background: #f0f0f0;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 1.1rem;
    color: #1f2937;
}

@media (max-width: 768px) {
    .content h1 {
        font-size: 2.2rem;
    }
    .content p {
        font-size: 1.1rem;
    }
    .card h2 a {
        font-size: 1.3rem;
    }
    .card p {
        font-size: 1.1rem;
    }
    .skills span {
        font-size: 0.9rem;
    }
}

/* ===========================
   Responsive Adjustments
=========================== */
@media (max-width: 768px) {
    header {
        padding: 1rem;
    }
    h1, h2 {
        font-size: 2.2rem;
    }
    p {
        font-size: 1.1rem;
    }
    .container {
        padding: 10px;
    }
    nav ul li a {
        font-size: 1rem;
    }
    .dropdown-content li a {
        font-size: 0.9rem;
    }
}

/* Gallery Grid Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.gallery-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.gallery-item p {
    padding: 15px;
    margin: 0;
    text-align: center;
    color: #333;
}

/* Modal Styles (same as certificates) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 5px;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #38bdf8;
}
/* Header container */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Make logo image large (at least photo size) */
.logo img {
    height: 180px;
    width: auto;
    display: block;
}

/* Burger container */
.burger {
    width: 30px;
    height: 22px;
    display: none; /* hidden on desktop */
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 1001; /* stay on top */
}

/* Lines */
.burger span {
    display: block;
    height: 4px;
    width: 100%;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* Active (turn into X) */
.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* Mobile only */
@media (max-width: 768px) {
    .burger {
        display: flex;
    }
    .logo img {
        height: 120px;
    }
}

/* Nav visible by default on desktop */
nav {
    display: block;
    position: static;
    background: none;
    width: auto;
    text-align: left;
    padding: 0;
}

/* Nav hidden by default on mobile, shown when active */
@media (max-width: 768px) {
    nav {
        display: none;
        position: absolute;
        top: 70px; /* below header */
        right: 0;
        background: #1e293b;
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
    nav.active {
        display: block;
    }
    nav ul {
        flex-direction: column;
        gap: 10px;
    }
}

/* Mobile Modal Styles */
@media (max-width: 768px) {
    .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.95);
        z-index: 1000;
        overflow: auto;
        align-items: center;
        justify-content: center;
        padding: 20px;
        box-sizing: border-box;
    }

    .modal-content {
        max-width: 100%;
        max-height: 70vh;
        width: auto;
        height: auto;
        margin: auto;
        display: block;
        animation: modalFadeIn 0.3s ease-out;
    }

    .close {
        position: fixed;
        top: 20px;
        right: 20px;
        color: white;
        font-size: 30px;
        z-index: 1001;
    }

    @keyframes modalFadeIn {
        from { opacity: 0; transform: scale(0.9); }
        to { opacity: 1; transform: scale(1); }
    }

    /* Gallery items for mobile */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .gallery-item img {
        height: 180px;
    }
}