/* =====================
   RESPONSIVE DESIGN
   ===================== */

/* Tablettes (768px à 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
  .container {
    max-width: 750px;
  }

  .section {
    padding: 3rem 1.5rem;
  }

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

  /* Navbar Tablet */
  .navbar-logo a {
    font-size: 1.4rem;
  }

  .navbar-menu {
    gap: 1.5rem;
  }

  /* Home Section */
  .home-section {
    padding-top: var(--tablet-padding-top-section);
  }

  .portfolio-title {
    font-size: 3rem;
  }

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

  .hero-title {
    font-size: 2.3rem;
  }

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

  .btn {
    padding: 0.7rem 1.8rem;
    font-size: 0.95rem;
  }

  /* About Section */
  .about-section {
    padding-top: var(--tablet-padding-top-section);
  }

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

  .container-logo {
    gap: 2rem;
  }

  .about-list-logo {
    display: block;
  }

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

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

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

  .skill-card {
    padding: 1.3rem;
  }

  /* Services Grid */
  .services-section {
    padding-top: var(--tablet-padding-top-section);
  }

  .services-grid {
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .service-card {
    flex: 0 1 calc(50% - 0.75rem);
    min-width: auto;
    padding: 1.25rem;
  }

  .service-card h3 {
    font-size: 1.2rem;
  }

  .service-card p {
    font-size: 0.95rem;
  }

  .service-icon {
    font-size: 2.7rem;
    height: 90px;
  }

  /* Projects Carousel */
  .projects-section {
    padding-top: var(--tablet-padding-top-section);
  }

  .projects-carousel {
    padding: 1rem;
    min-height: auto;
  }

  .carousel-cards {
    gap: 1rem;
    height: 350px;
    z-index: 10;
  }

  .project-item {
    border-radius: 10px;
  }

  .carousel-center {
    height: auto;
    min-width: 280px;
    display: flex;
    flex-direction: column;
  }

  .carousel-center .project-image {
    height: 180px;
  }

  /* Hide project details on left/right cards - always hidden in mobile */
  .carousel-left .project-details,
  .carousel-right .project-details {
    display: none;
  }

  /* Project Details - Accordion Animation on Mobile (center card only) */
  .carousel-center .project-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      max-height 0.4s ease,
      opacity 0.4s ease;
    padding: 0;
    display: block;
    transform-origin: top;
    flex-shrink: 0;
  }

  .carousel-center .project-details.active {
    opacity: 1;
    padding: 0.75rem;
  }

  .carousel-center .project-header {
    padding: 0.75rem;
  }

  .carousel-center .project-info h3 {
    font-size: 1rem;
  }

  .carousel-center .project-info p {
    font-size: 0.85rem;
  }

  .tech-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }

  .project-date {
    font-size: 0.85rem;
  }

  .project-link {
    font-size: 0.9rem;
  }

  /* Contact Section */
  .contact-section {
    padding-top: var(--tablet-padding-top-section);
  }

  .contact-form {
    max-width: 750px;
    padding: 1.8rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.7rem;
    font-size: 0.95rem;
  }

  .contact-content {
    gap: 2rem;
  }

  .contact-info {
    padding: 1.5rem;
  }

  /* Footer */
  .footer-container {
    padding: 0 3%;
  }

  .logo {
    height: 45px;
  }

  .social-links {
    gap: 0.9rem;
  }

  .social-links a {
    width: 42px;
    height: 42px;
  }

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

/* Mobiles (< 768px) */
@media (max-width: 767px) {
  :root {
    --spacing-unit: 1rem;
  }

  /* Navbar Mobile */
  .navbar {
    height: 60px;
  }

  .navbar-container {
    position: relative;
    height: 60px;
    padding: 0 1rem;
    gap: 40%;
  }

  .navbar-menu {
    position: absolute;
    top: 60px;
    left: -100%;
    flex-direction: column;
    background-color: white;
    width: 100%;
    text-align: center;
    transition: left 0.3s ease;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
    padding: 1.5rem 0;
    gap: 0;
  }

  .navbar-menu.active {
    left: 0;
  }

  .navbar-logo a {
    font-size: 1.2rem;
  }

  .menu-icon {
    display: flex;
    background: none;
    border: none;
  }

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

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

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

  .nav-item {
    padding: 0.5rem 0;
  }

  .nav-link {
    padding: 0.25rem 0.75rem;
    font-size: 0.95rem;
  }

  .nav-link::after {
    display: none;
  }

  /* Sections */
  .section {
    padding: 2.5rem 1rem;
  }

  .container {
    padding: 0 0;
  }

  .section-title {
    font-size: 1.5rem;
    padding-bottom: 0;
    margin-bottom: 0;
  }

  /* Home Section */
  .home-section {
    padding-top: 80px;
    min-height: auto;
  }

  .portfolio-title {
    font-size: 2.5rem;
  }

  .hero-image {
    scale: 0.8;
  }

  .home-content-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }

  .init-title {
    font-size: 1.2rem;
  }

  .hero-title {
    font-size: 1.5rem;
    padding-left: 10px;
  }

  .hero-sous-title {
    font-size: 1.5rem;
    padding-left: 30px;
  }

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

  .hero-description,
  .about-text p,
  .services-section p,
  .projects-section p,
  .contact-section p {
    font-size: 0.95rem;
    max-width: 100%;
    line-height: 1.6;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
  }

  /* About Section */
  .about-section {
    padding-top: var(--mobile-padding-top-section);
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    position: relative;
  }

  .about-text {
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
  }

  .about-text h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.75rem;
  }

  .about-container-logo {
    position: absolute;
    display: block;
    width: 100%;
  }

  .about-list-logo {
    display: block;
  }

  .about-icon {
    display: flex;
    margin: 3rem 0;
    height: 60px;
    font-size: 2.2rem;
    opacity: 0;
    z-index: -100;
    visibility: hidden;
  }

  .about-container-logo > :nth-child(3) > :nth-child(1),
  .about-container-logo > :nth-child(3) > :nth-child(2) {
    height: 30px;
  }

  /* Services Grid */
  .services-section {
    padding-top: var(--mobile-padding-top-section);
  }

  .services-grid {
    padding: 1rem;
    gap: 1.5rem;
  }

  .service-card {
    flex: 0 1 100%;
    min-width: auto;
    padding: 1.25rem;
    border-radius: 16px;
  }

  .service-card h3 {
    font-size: 1.1rem;
  }

  .service-icon {
    font-size: 2.2rem;
    height: 70px;
  }
  /*====================
  Projects Carousel
  =====================*/
  .projects-section {
    padding-top: var(--mobile-padding-top-section);
  }

  .projects-carousel {
    padding: 0;
    min-height: auto;
  }

  .carousel-cards {
    gap: 1rem;
    height: fit-content;
    align-items: start;
    z-index: 10;
    overflow: hidden;
    padding: 3rem;
  }

  .project-item {
    border-radius: 10px;
  }

  .carousel-center {
    height: auto;
    min-width: 300px;
    display: flex;
    flex-direction: column;
  }

  .carousel-center .project-image {
    height: 180px;
  }

  /* Hide left/right cards completely on mobile - hide parent and all children */
  .carousel-left,
  .carousel-right {
    display: none !important;
  }

  /* Project Details - Accordion Animation on Mobile (center card only) */
  .carousel-center .project-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition:
      max-height 0.4s ease,
      opacity 0.4s ease;
    padding: 0;
    display: block;
    transform-origin: top;
    flex-shrink: 0;
  }

  .carousel-center .project-details.active {
    opacity: 1;
    padding: 0.75rem;
  }

  .carousel-center .project-header {
    padding: 0.75rem;
  }

  .carousel-center .project-info h3 {
    font-size: 1rem;
  }

  .carousel-center .project-info p {
    font-size: 0.95rem;
  }

  .tech-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
  }

  .project-date {
    font-size: 0.85rem;
  }

  .project-link {
    font-size: 0.9rem;
  }

  /* Pagination Dots Mobile */
  .carousel-pagination {
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding: 0 1rem;
    height: 40px;
  }

  .pagination-dot {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
  }

  .pagination-dot.active {
    box-shadow: 0 0 8px rgba(78, 120, 255, 0.4);
    transform: scale(1.05);
  }

  .pagination-dot:hover {
    transform: scale(1.1);
  }

  /*====================
   Contact Section
   =====================*/
  .contact-section {
    padding-top: var(--mobile-padding-top-section);
  }

  .contact-form {
    padding: 1.5rem;
    border-radius: 12px;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-group label {
    font-size: 0.95rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 0.65rem;
    font-size: 0.95rem;
  }

  #formMessage {
    font-size: 0.9rem;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-info {
    padding: 1.5rem;
  }

  .contact-info h3 {
    font-size: 1rem;
  }

  .info-item {
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .info-item i {
    font-size: 1.1rem;
  }

  /* Footer */
  .footer-container {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 2rem;
  }

  .logo {
    height: 40px;
  }

  .social-links {
    justify-content: center;
    gap: 0.75rem;
  }

  .social-links a {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .footer {
    padding: 1rem;
  }

  .footer p {
    font-size: 0.95rem;
  }

  .footer-info {
    flex-direction: column;
    padding: 1.5rem;
  }
}

/* Très petits mobiles (< 480px) */
@media (max-width: 479px) {
  .hero-title {
    font-size: 1.5rem;
  }

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

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

  .section-title::after {
    width: 40px;
  }

  .skill-card h4 {
    font-size: 1rem;
  }

  .skill-card li {
    font-size: 0.9rem;
  }

  .service-card h3 {
    font-size: 1.1rem;
  }

  /* Pagination Dots Ultra Mobile */
  .carousel-pagination {
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0 0.5rem;
  }

  .pagination-dot {
    width: 9px;
    height: 9px;
    border-width: 1.5px;
  }

  .pagination-dot.active {
    transform: scale(1);
  }

  .pagination-dot:hover {
    transform: scale(1.05);
  }

  .form-group label {
    font-size: 0.95rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 0.95rem;
    padding: 0.6rem;
  }

  .contact-info h3 {
    font-size: 1.1rem;
  }

  .info-item {
    font-size: 0.95rem;
  }

  .social-links a {
    width: 40px;
    height: 40px;
  }

  .social-links a i {
    font-size: 1.2rem;
  }
}

/* Orientation Landscape */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

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

  .cta-buttons {
    gap: 0.5rem;
  }

  .btn {
    padding: 0.6rem 1.5rem;
  }

  .section {
    padding: 6rem 1rem;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
}

/* Print Styles */
@media print {
  body {
    background-color: white;
  }

  .navbar,
  .footer {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }
}
