/* HERO SECTION  */
/* Mobile screens only (up to 767px) */
@media (max-width: 767px) {
    .hero-section {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem 1rem;
        /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
        position: relative;
        overflow: hidden;
        background-color: black;
    }

    .hero-section::before {
        content: '';
        position: absolute;
        top: -50%;
        right: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
        background-size: 30px 30px;
        animation: moveBackground 20s linear infinite;
    } 

    @keyframes moveBackground {
        0% { transform: translate(0, 0); }
        100% { transform: translate(30px, 30px); }
    }

    .hero-text {
        
        z-index: 2;
        animation: fadeInUp 0.8s ease-out;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .hero-text .text1 {
        font-size: 1.8rem;
        font-weight: 500;
        color: #ffffff;
        margin-bottom: 0.5rem;
        animation: slideInLeft 0.6s ease-out;
    }

    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .hero-text .text2 {
        font-size: 2rem;
       
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        animation: slideInRight 0.6s ease-out 0.2s both;
    }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .hero-text .text2 strong {
        font-weight: 700;
        position: relative;
        display: inline-block;
    }

    .hero-text .text2 strong::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 0;
        width: 100%;
        height: 3px;
        background: #ffd700;
        animation: expandWidth 0.8s ease-out 0.8s both;
    }

    @keyframes expandWidth {
        from { width: 0; }
        to { width: 100%; }
    }

    .hero-text .text3 {
        font-size: 1.3rem;
        font-weight: 500;
        color: #e0e0e0;
        margin-bottom: 2rem;
        animation: fadeIn 0.8s ease-out 0.4s both;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

   .hero-section .btns {
        display: flex;
        gap: 1rem;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        animation: fadeInUp 1s ease-out 0.6s both;
        margin-top: 1.5rem;
    }

    .hero-section .btns .btn {
        width: 60px;
        height: 60px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        border: none;
        position: relative;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        cursor: pointer;
    }

    .hero-section .btns .btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255,255,255,0.3);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .hero-section .btns .btn:hover::before {
        width: 120%;
        height: 120%;
    }

    .hero-section .btns .btn i {
        font-size: 1.5rem;
        position: relative;
        z-index: 1;
        transition: all 0.3s ease;
    }

    /* Primary buttons (Contact & Github) */
    .hero-section .btns .btn-primary {
        background: linear-gradient(135deg, #ffd700, #ffed4e);
        color: #333;
        animation: bounceIn 0.8s ease-out both;
    }

    .hero-section .btns .btn-primary:nth-child(1) {
        animation-delay: 0.7s;
    }

    .hero-section .btns .btn-primary:nth-child(3) {
        animation-delay: 0.9s;
    }

    @keyframes bounceIn {
        0% {
            opacity: 0;
            transform: scale(0.3);
        }
        50% {
            transform: scale(1.1);
        }
        70% {
            transform: scale(0.9);
        }
        100% {
            opacity: 1;
            transform: scale(1);
        }
    }

    .hero-section .btns .btn-primary:hover {
        background: linear-gradient(135deg, #ffed4e, #ffd700);
        transform: translateY(-5px) scale(1.1);
        box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
    }

    .hero-section .btns .btn-primary:hover i {
        transform: scale(1.2) rotate(10deg);
    }

    /* Secondary buttons (CV & LinkedIn) */
    .hero-section .btns .btn-secondary {
        background: linear-gradient(135deg, #667eea, #764ba2);
        border: 2px solid rgba(255,255,255,0.3);
        color: #ffffff;
        animation: bounceIn 0.8s ease-out both;
    }

    .hero-section .btns .btn-secondary:nth-child(2) {
        animation-delay: 0.8s;
    }

    .hero-section .btns .btn-secondary:nth-child(4) {
        animation-delay: 1s;
    }

    .hero-section .btns .btn-secondary:hover {
        background: linear-gradient(135deg, #764ba2, #667eea);
        border-color: rgba(255,255,255,0.6);
        transform: translateY(-5px) scale(1.1);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    }

    .hero-section .btns .btn-secondary:hover i {
        transform: scale(1.2) rotate(-10deg);
    }

    /* Active/Click effect */
    .hero-section .btns .btn:active {
        transform: translateY(-2px) scale(0.95);
        box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    }

    /* Pulse animation for attention */
    @keyframes pulse {
        0%, 100% {
            box-shadow: 0 5px 15px rgba(0,0,0,0.2);
        }
        50% {
            box-shadow: 0 5px 25px rgba(255,215,0,0.6);
        }
    }

    .hero-section .btns .btn-primary:nth-child(1) {
        animation: bounceIn 0.8s ease-out 0.7s both, pulse 2s ease-in-out 2s infinite;
    }

    /* Tooltip effect (optional) */
    .hero-section .btns .btn::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: -35px;
        left: 50%;
        transform: translateX(-50%) scale(0);
        background: rgba(0,0,0,0.8);
        color: #ffffff;
        padding: 0.3rem 0.6rem;
        border-radius: 5px;
        font-size: 0.75rem;
        white-space: nowrap;
        opacity: 0;
        transition: all 0.3s ease;
        pointer-events: none;
    }

    .hero-section .btns .btn:hover::after {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    /* Extra small devices */
    @media (max-width: 375px) {
        .hero-section .btns .btn {
            width: 55px;
            height: 55px;
        }

        .hero-section .btns .btn i {
            font-size: 1.3rem;
        }

        .hero-section .btns {
            gap: 0.8rem;
        }
    }

    .hero-image {
        margin-top: 2rem;
        z-index: 2;
        animation: fadeInScale 1s ease-out 0.8s both;
    }

    @keyframes fadeInScale {
        from {
            opacity: 0;
            transform: scale(0.8);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .hero-image img {
        width: 230px;
        height: 230px;
        border-radius: 50%;
        object-fit: cover;
        border: 10px solid #ffffff;
        box-shadow: 0 10px 40px rgba(0,0,0,0.3);
        animation: float 3s ease-in-out infinite;
    }

    @keyframes float {
        0%, 100% {
            transform: translateY(0);
        }
        50% {
            transform: translateY(-15px);
        }
    }

    /* Extra small devices */
    @media (max-width: 375px) {
        .hero-text .text1 {
            font-size: 1.5rem;
        }

        .hero-text .text2 {
            font-size: 1.7rem;
        }

        .hero-text .text3 {
            font-size: 1.1rem;
        }

        .hero-image img {
            width: 200px;
            height: 200px;
        }

        .hero-text .btns .btn {
            padding: 0.6rem 1.5rem;
            font-size: 0.9rem;
        }
    }
}

/* Mobile screens only (up to 767px) */
@media (max-width: 767px) {
    .education-section {
        padding: 3rem 1rem;
        background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
        position: relative;
        overflow: hidden;
    }

    .education-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="%23667eea" opacity="0.1"/></svg>');
        background-size: 50px 50px;
        pointer-events: none;
    }

    .education-section .row {
        margin: 0;
        padding: 0;
    }

    .education-section .col-6 {
        width: 100%;
        padding: 0 15px;
    }

    .education-content {
        position: relative;
        z-index: 1;
    }

    .section-title {
        text-align: center;
        margin-bottom: 2.5rem;
        animation: fadeInDown 0.8s ease-out;
    }

    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .section-title h2 {
        font-size: 2rem;
        font-weight: 700;
        color: #2c3e50;
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 2px;
    }

    .section-title .underline {
        width: 80px;
        height: 4px;
        background: linear-gradient(to right, #667eea, #764ba2);
        margin: 0 auto;
        border-radius: 2px;
        animation: expandUnderline 0.8s ease-out 0.3s both;
    }

    @keyframes expandUnderline {
        from { width: 0; }
        to { width: 80px; }
    }

    .education-timeline {
        position: relative;
        padding-left: 30px;
    }

    .education-timeline::before {
        content: '';
        position: absolute;
        left: 10px;
        top: 0;
        bottom: 0;
        width: 3px;
        background: linear-gradient(to bottom, #667eea, #764ba2);
        animation: drawLine 1.5s ease-out;
    }

    @keyframes drawLine {
        from { height: 0; }
        to { height: 100%; }
    }

    .education-item {
        position: relative;
        margin-bottom: 2.5rem;
        padding: 1.5rem;
        background: #ffffff;
        border-radius: 15px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.08);
        transition: all 0.3s ease;
        animation: slideInRight 0.6s ease-out both;
    }

    .education-item:nth-child(1) { animation-delay: 0.2s; }
    .education-item:nth-child(2) { animation-delay: 0.4s; }
    .education-item:nth-child(3) { animation-delay: 0.6s; }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .education-item:hover {
        transform: translateX(5px);
        box-shadow: 0 8px 30px rgba(102,126,234,0.2);
    }

    .education-item::before {
        content: '';
        position: absolute;
        left: -33px;
        top: 25px;
        width: 16px;
        height: 16px;
        background: #667eea;
        border: 4px solid #ffffff;
        border-radius: 50%;
        box-shadow: 0 0 0 4px rgba(102,126,234,0.2);
        z-index: 2;
        animation: pulse 2s ease-in-out infinite;
    }

    @keyframes pulse {
        0%, 100% {
            box-shadow: 0 0 0 4px rgba(102,126,234,0.2);
        }
        50% {
            box-shadow: 0 0 0 8px rgba(102,126,234,0.1);
        }
    }

    .degree-header {
        margin-bottom: 0.8rem;
    }

    .degree-title {
        font-size: 1.2rem;
        font-weight: 700;
        color: #2c3e50;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .duration {
        display: inline-block;
        font-size: 0.85rem;
        font-weight: 600;
        color: #ffffff;
        background: linear-gradient(135deg, #667eea, #764ba2);
        padding: 0.3rem 0.8rem;
        border-radius: 20px;
        margin-top: 0.3rem;
    }

    .university {
        font-size: 1rem;
        font-weight: 600;
        color: #667eea;
        margin-bottom: 1rem;
        font-style: italic;
    }

    .thesis-project {
        margin-top: 1rem;
        padding: 1rem;
        background: #f8f9fa;
        border-left: 4px solid #667eea;
        border-radius: 8px;
    }

    .thesis-project strong {
        display: block;
        font-size: 0.9rem;
        font-weight: 700;
        color: #2c3e50;
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .thesis-project p {
        font-size: 0.95rem;
        color: #5a6c7d;
        line-height: 1.6;
        margin: 0;
    }

    /* Extra small devices */
    @media (max-width: 375px) {
        .education-section {
            padding: 2rem 0.5rem;
        }

        .section-title h2 {
            font-size: 1.7rem;
        }

        .degree-title {
            font-size: 1.1rem;
        }

        .education-item {
            padding: 1.2rem;
        }

        .thesis-project {
            padding: 0.8rem;
        }
    }
}

/* Mobile screens only (up to 767px) */
@media (max-width: 767px) {
    .contact-section {
        padding: 3rem 1rem !important;
        /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
        position: relative;
        overflow: hidden;
        min-height: auto;
        padding-bottom: 4.5rem !important;
    }

    .contact-section::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.05) 2px, transparent 2px);
        background-size: 40px 40px;
        animation: rotateBackground 30s linear infinite;
    }

    @keyframes rotateBackground {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }

    .contact-section .row {
        margin: 0;
        padding: 0;
        position: relative;
        z-index: 1;
    }

    .contact-section .col-2,
    .contact-section .col-4 {
        display: none;
    }

    .contact-section .col-5 {
        width: 100%;
        padding: 0 15px;
        animation: fadeInUp 0.8s ease-out;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .contact-section h2 {
        font-size: 2rem;
        font-weight: 700;
        color: #ffffff;
        text-transform: uppercase;
        letter-spacing: 2px;
        position: relative;
        padding-bottom: 1rem !important;
        animation: slideInDown 0.6s ease-out;
    }

    @keyframes slideInDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .contact-section h2::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 4px;
        background: #ffd700;
        border-radius: 2px;
        animation: expandWidth 0.8s ease-out 0.3s both;
    }

    @keyframes expandWidth {
        from { width: 0; }
        to { width: 80px; }
    }

    .alert-success {
        background: linear-gradient(135deg, #28a745, #20c997) !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 15px;
        padding: 1rem !important;
        font-weight: 600;
        box-shadow: 0 5px 20px rgba(40, 167, 69, 0.3);
        animation: bounceIn 0.6s ease-out;
    }

    @keyframes bounceIn {
        0% {
            opacity: 0;
            transform: scale(0.3);
        }
        50% {
            transform: scale(1.05);
        }
        100% {
            opacity: 1;
            transform: scale(1);
        }
    }

    .contact-form {
        background: #ffffff;
        padding: 2rem;
        border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.2);
        animation: scaleIn 0.8s ease-out 0.2s both;
    }

    @keyframes scaleIn {
        from {
            opacity: 0;
            transform: scale(0.9);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .form-group {
        position: relative;
        animation: fadeInLeft 0.6s ease-out both;
    }

    .form-group:nth-child(1) { animation-delay: 0.3s; }
    .form-group:nth-child(2) { animation-delay: 0.4s; }
    .form-group:nth-child(3) { animation-delay: 0.5s; }
    .form-group:nth-child(4) { animation-delay: 0.6s; }

    @keyframes fadeInLeft {
        from {
            opacity: 0;
            transform: translateX(-20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .form-group label {
        display: block;
        font-size: 0.95rem;
        font-weight: 600;
        color: #2c3e50;
        margin-bottom: 0.5rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .form-group input,
    .form-group textarea {
        width: 100%;
        padding: 0.9rem 1rem;
        font-size: 1rem;
        color: #2c3e50;
        background: #f8f9fa;
        border: 2px solid #e9ecef;
        border-radius: 10px;
        transition: all 0.3s ease;
        outline: none;
    }

    .form-group input:focus,
    .form-group textarea:focus {
        background: #ffffff;
        border-color: #667eea;
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
        transform: translateY(-2px);
    }

    .form-group textarea {
        min-height: 150px;
        resize: vertical;
        font-family: inherit;
    }

    .form-group input::placeholder,
    .form-group textarea::placeholder {
        color: #adb5bd;
    }

    .contact-form button[type="submit"] {
        margin-top: 1rem;
        padding: 1rem;
        font-size: 1.1rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        background: linear-gradient(135deg, #667eea, #764ba2);
        border: none;
        border-radius: 50px;
        color: #ffffff;
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
        transition: all 0.3s ease;
        cursor: pointer;
        animation: fadeIn 0.8s ease-out 0.7s both;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .contact-form button[type="submit"]:hover {
        background: linear-gradient(135deg, #764ba2, #667eea);
        transform: translateY(-3px);
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
    }

    .contact-form button[type="submit"]:active {
        transform: translateY(-1px);
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    }

    /* Form validation styles */
    .form-group input.is-invalid,
    .form-group textarea.is-invalid {
        border-color: #dc3545;
    }

    .form-group input.is-valid,
    .form-group textarea.is-valid {
        border-color: #28a745;
    }

    /* Extra small devices */
    @media (max-width: 375px) {
        .contact-section {
            padding: 2rem 0.5rem !important;
            padding-bottom: 4.5rem !important;
        }

        .contact-section h2 {
            font-size: 1.7rem;
        }

        .contact-form {
            padding: 1.5rem;
        }

        .form-group input,
        .form-group textarea {
            padding: 0.8rem;
            font-size: 0.95rem;
        }

        .contact-form button[type="submit"] {
            font-size: 1rem;
            padding: 0.9rem;
        }
    }

    @media (max-width: 767px) {
  .contact-section {
    overflow: visible !important;  /* stop clipping the footer */
    isolation: auto !important;    /* reset stacking context */
  }

  .contact-section::before {
    overflow: hidden;   /* contain the animation blob inside instead */
    border-radius: inherit;
  }

  #page-footer {
    position: relative;
    z-index: 10;
  }
}
}

/* Fix footer visibility on mobile */

/* ============================================================
   PROJECTS SECTION — MOBILE ONLY  (max-width: 767.98px)
   ============================================================ */
@media (max-width: 767.98px) {

  /* ── Section wrapper ── */
  #projects {
    padding: 3rem 1rem !important;
  }

  /* ── Section title ── */
  #projects .section-title {
    font-size: 1.6rem;
    margin-bottom: 2rem;
    justify-content: center;
    text-align: center;
  }

  /* ── Rows ── */
  #projects .row {
    gap: 1.25rem 0;
  }

  #projects .row.pt-5 {
    padding-top: 1.5rem !important;
  }

  /* ── Each column full-width & centred ── */
  #projects .col-12 {
    width: 100%;
    padding-inline: 0.5rem;
  }

  /* ── Card wrapper ── */
  .project-wrapper {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  }

  /* ── Project card ── */
  .project-card {
    border-radius: 16px;
    overflow: hidden;
  }

  /* ── Image container: fixed height on mobile ── */
  .project-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: 16px;
  }

  .project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
  }

  /* ── Overlay: always visible on mobile (no hover) ── */
  .project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to top,
      rgba(10, 10, 30, 0.92) 0%,
      rgba(10, 10, 30, 0.55) 55%,
      transparent 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 1.1rem;
    border-radius: 16px;
  }

  /* ── Overlay content ── */
  .overlay-content {
    width: 100%;
  }

  .project-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.3rem;
    line-height: 1.3;
  }

  .project-description {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.80);
    margin-bottom: 0.6rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* ── Tech badges ── */
  .project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
  }

  .project-tech .badge {
    font-size: 0.65rem;
    padding: 0.3em 0.6em;
    border-radius: 6px;
    letter-spacing: 0.03em;
  }

  /* ── Action buttons ── */
  .project-links {
    display: flex;
    gap: 0.5rem;
  }

  .project-links .btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    font-weight: 600;
  }

}
