/* Base Styles */
body {
  background-color: var(--page-bg);
  color: var(--page-text);
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
}

/* Header Section */
.header {
  height: 350px;
  background: linear-gradient(
    135deg,
    var(--header-bg-start) 0%,
    var(--header-bg-end) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 60px;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(var(--header-overlay), rgba(0, 0, 0, 0.4));
  z-index: 1;
  border-radius: 0 0 20px 20px;
}

.header-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
  max-width: 1200px;
}

.header-text {
  flex: 1;
}

.header h1 {
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
  font-size: 2.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
}

/* Body Content */
.body {
  margin-top: 5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
}

/* Project Filters */
.project-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background-color: transparent;
  border: 2px solid #1f50dc;
  color: var(--color-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0.25rem;
}

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--color-primary);
  color: var(--page-text);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(100, 75, 191, 0.3);
}

/* Cards Container */
.cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
  width: 100%;
  max-width: 1200px;
  margin-bottom: 5rem;
}

/* Project Items */
.bordercard {
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
  width: calc(33.33% - 20px);
  min-width: 300px;
  margin-bottom: 25px;
}

.project-item {
  opacity: 0;
  transition: all 0.5s ease;
}

.project-item.visible {
  opacity: 1;
}

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

.project-item.animate-filtered {
  animation: fadeInUp 0.6s ease forwards;
}

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

/* Card Styling */
.card {
  width: 100%;
  max-width: 350px;
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  position: relative;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 25px rgba(31, 80, 220, 0.2);
  border-color: #1f50dc;
}

.card-category {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: var(--color-primary);
  color: var(--page-text);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  z-index: 2;
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  color: var(--page-text);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  transition: color 0.3s ease;
}

.card:hover .card-title {
  color: var(--color-primary);
}

.card-text {
  color: var(--page-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.btn-view {
  background-color: var(--color-primary);
  color: var(--page-text);
  padding: 0.6rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-view:hover {
  background-color: #1640b3;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(31, 80, 220, 0.3);
  color: var(--page-text);
}

/* Modal Styling */
.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
}

.modal-header {
  border-bottom: 1px solid #262626;
  padding: 1.5rem;
}

.modal-title {
  color: var(--page-text);
  font-weight: 600;
  font-size: 1.5rem;
}

.btn-close {
  filter: invert(1);
}

.modal-body {
  padding: 1.5rem;
}

.project-modal-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-modal-image-container {
  position: relative;
}

.project-modal-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 8px;
}

.project-modal-category {
  position: absolute;
  top: 15px;
  right: 15px;
  background-color: var(--color-primary);
  color: var(--page-text);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
}

.project-modal-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-modal-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-modal-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--page-text-muted);
  font-size: 0.9rem;
}

.project-modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tech-badge {
  background-color: var(--page-bg);
  color: var(--accent-color);
  padding: 0.35rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #4bbf73;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.project-modal-description {
  color: var(--page-text-muted);
  line-height: 1.6;
  font-size: 1rem;
}

.modal-footer {
  border-top: 1px solid #262626;
  padding: 1.5rem;
}

.btn-close-modal {
  background-color: var(--accent-color);
  color: var(--page-text);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-close-modal:hover {
  background-color: #3da862;
  transform: translateY(-2px);
}

/* Footer */
.projects-footer {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 3rem;
  border-top: 1px solid #262626;
}

.projects-footer p {
  color: var(--page-text-muted);
  font-size: 1.1rem;
  margin: 0;
}

.projects-footer a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.projects-footer a:hover {
  color: #3da862;
}

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

/* ===== LARGE DESKTOP (1200px+) ===== */
@media (min-width: 1200px) {
  .bordercard {
    width: calc(33.33% - 20px);
  }
}

/* ===== <1200px ===== */
@media (max-width: 1200px) {
  .header {
    height: 350px;
  }

  .header h1 {
    font-size: 3rem;
  }
}

/* ===== <1000px ===== */
@media (max-width: 1000px) {
  .cards {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .bordercard {
    width: 100%;
    max-width: 500px;
  }
}

/* ===== DESKTOP/LAPTOP (992px - 1199px) ===== */
@media (max-width: 1199px) and (min-width: 993px) {
  .bordercard {
    width: calc(50% - 20px);
  }
}

@media (max-width: 992px) {
  /* Header */
  .header {
    height: 400px;
    padding: 2rem 1rem;
  }

  .header h1 {
    margin-top: 120px;
    font-size: 4.5rem !important;
    margin-bottom: 1.5rem;
  }

  .header p {
    font-size: 1.8rem !important;
    line-height: 1.5;
  }

  /* Body */
  .body {
    margin-top: 3%;
    padding: 0 1.5rem;
  }

  /* Project Filters - Agrandissement */
  .project-filters {
    margin-bottom: 4rem;
    gap: 1.5rem;
  }

  .filter-btn {
    padding: 1.2rem 2.5rem !important;
    font-size: 1.8rem !important;
    font-weight: 600;
    border-width: 3px;
  }

  /* Cards - Agrandissement */
  .cards {
    gap: 50px;
    justify-content: center;
  }

  .bordercard {
    width: calc(50% - 50px);
    min-width: 650px;
    max-width: 750px;
  }

  .card {
    max-width: 750px !important;
    min-height: 500px;
  }

  .card-category {
    top: 25px;
    right: 25px;
    padding: 0.8rem 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
  }

  .card-img-top {
    height: 300px;
  }

  .card-body {
    padding: 40px;
  }

  .card-title {
    font-size: 2.2rem !important;
    margin-bottom: 1.5rem;
    font-weight: 700;
  }

  .card-text {
    font-size: 1.8rem !important;
    line-height: 1.7;
    margin-bottom: 2rem;
  }

  .btn-view {
    padding: 1.2rem 2.5rem !important;
    font-size: 1.6rem !important;
    font-weight: 600;
    gap: 0.8rem;
  }

  .btn-view i {
    font-size: 1.4rem;
  }

  /* Modal - Agrandissement */
  .modal-dialog {
    max-width: 90%;
  }

  .modal-header {
    padding: 2.5rem;
  }

  .modal-title {
    font-size: 2.5rem !important;
    font-weight: 700;
  }

  .btn-close {
    width: 2rem;
    height: 2rem;
  }

  .modal-body {
    padding: 2.5rem;
  }

  .project-modal-content {
    gap: 2.5rem;
  }

  .project-modal-image {
    height: 350px;
  }

  .project-modal-category {
    top: 25px;
    right: 25px;
    padding: 0.8rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
  }

  .project-modal-info {
    gap: 2rem;
  }

  .project-modal-date {
    font-size: 1.5rem;
    gap: 0.8rem;
  }

  .project-modal-date i {
    font-size: 1.3rem;
  }

  .tech-badge {
    padding: 0.8rem 1.5rem;
    font-size: 1.3rem;
    font-weight: 600;
    gap: 0.6rem;
    border-width: 2px;
  }

  .tech-badge i {
    font-size: 1.1rem;
  }

  .project-modal-description {
    font-size: 1.6rem !important;
    line-height: 1.8;
  }

  .modal-footer {
    padding: 2.5rem;
  }

  .btn-close-modal {
    padding: 1.2rem 2.5rem !important;
    font-size: 1.6rem !important;
    font-weight: 600;
  }

  /* Footer - Agrandissement */
  .projects-footer {
    padding: 4rem 2rem;
    margin-top: 4rem;
  }

  .projects-footer p {
    font-size: 1.8rem !important;
    line-height: 1.6;
  }
}

/* ===== TABLET PORTRAIT (768px - 991px) ===== */
@media (min-width: 768px) and (max-width: 991px) {
  .bordercard {
    width: 90%;
    max-width: 500px;
    margin: 0 auto 30px;
  }

  .project-filters {
    justify-content: center;
  }

  .modal-dialog {
    max-width: 95%;
  }
}

/* ===== TABLET PORTRAIT & MOBILE (768px) ===== */
@media (max-width: 768px) {
  /* Header */
  .header {
    height: 350px;
    padding: 1.5rem 1rem;
  }

  .header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }

  .header p {
    font-size: 1.1rem;
  }

  /* Body */
  .body {
    margin-top: 2%;
    padding: 0 15px;
  }

  /* Project Filters */
  .project-filters {
    margin-bottom: 2rem;
    gap: 0.75rem;
  }

  .filter-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  /* Cards */
  .cards {
    gap: 20px;
  }

  .bordercard {
    width: 100%;
    min-width: unset;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .card {
    max-width: 100%;
  }

  .card-category {
    top: 12px;
    right: 12px;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

  .card-img-top {
    height: 180px;
  }

  .card-body {
    padding: 1.25rem;
  }

  .card-title {
    font-size: 1.15rem;
  }

  .card-text {
    font-size: 0.9rem;
  }

  .btn-view {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    gap: 0.4rem;
  }

  /* Modal */
  .modal-dialog {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1.25rem;
  }

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

  .project-modal-content {
    gap: 1.25rem;
  }

  .project-modal-image {
    height: 200px;
  }

  .project-modal-category {
    top: 12px;
    right: 12px;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .project-modal-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

  .tech-badge {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .project-modal-description {
    font-size: 0.9rem;
  }

  .btn-close-modal {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }

  /* Footer */
  .projects-footer {
    padding: 2rem 1rem;
    margin-top: 2rem;
  }

  .projects-footer p {
    font-size: 1rem;
  }
}

/* ===== MOBILE LARGE (576px - 767px) ===== */
@media (min-width: 576px) and (max-width: 767px) {
  .header-content {
    padding: 0 1.5rem;
  }
}

/* ===== MOBILE (576px) ===== */
@media (max-width: 576px) {
  /* Header */
  .header {
    height: 300px;
    padding: 1rem 0.75rem;
  }

  .header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
  }

  .header p {
    font-size: 1rem;
  }

  /* Body */
  .body {
    padding: 0 10px;
  }

  /* Project Filters */
  .project-filters {
    margin-bottom: 1.5rem;
    gap: 0.5rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    margin: 0.15rem;
  }

  /* Cards */
  .cards {
    gap: 15px;
  }

  .bordercard {
    margin-bottom: 15px;
  }

  .card {
    width: 100% !important;
    max-width: 95vw;
  }

  .card-category {
    top: 10px;
    right: 10px;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
  }

  .card-img-top {
    height: 160px;
  }

  .card-body {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.05rem;
    margin-bottom: 0.6rem;
  }

  .card-text {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }

  .btn-view {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
  }

  /* Modal */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

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

  .project-modal-image {
    height: 180px;
  }

  .project-modal-category {
    top: 10px;
    right: 10px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .project-modal-date {
    font-size: 0.8rem;
  }

  .tech-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    gap: 0.2rem;
  }

  .project-modal-description {
    font-size: 0.85rem;
  }

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

  /* Footer */
  .projects-footer {
    padding: 1.5rem 0.75rem;
  }

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

/* ===== MOBILE SMALL (375px) ===== */
@media (max-width: 375px) {
  .header h1 {
    font-size: 1.9rem;
  }

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

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

  .card-title {
    font-size: 1rem;
  }

  .card-text {
    font-size: 0.8rem;
  }

  .btn-view {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
  }

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

  .project-modal-image {
    height: 160px;
  }

  .projects-footer p {
    font-size: 0.85rem;
  }
}

/* Disable animations on mobile for performance */
@media (max-width: 1024px) {
  .animate__animated,
  .animate__fadeInUp,
  .animate__fadeIn,
  .animate__fadeInDown,
  .animate__delay-1s {
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* Disable custom animations */
  .project-item.animate-filtered {
    animation: none !important;
  }

  /* Disable hover effects on mobile */
  .card:hover,
  .btn-view:hover,
  .filter-btn:hover {
    transform: none !important;
    transition: none !important;
  }
}

.project-image-wrapper {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 8px;
}

.project-image-wrapper:hover .project-modal-image {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: var(--page-text);
  font-weight: 500;
}

.project-image-wrapper:hover .image-overlay {
  opacity: 1;
}

.image-overlay i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.btn-view-project {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: var(--page-text);
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-view-project:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
  color: var(--page-text);
}

/* GRADIENT
/* ===== ANIMATED GRADIENT - HEADERS ONLY ===== */

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Pages autres que home (about, contact, projects) */
.header {
  background: linear-gradient(-45deg, #1f50dc, #4bbf73, #1f50dc, #4bbf73);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
  position: relative;
  z-index: 1;
}

/* Exclure le header inverted de la home */
.header:not(.inverted) {
  background: linear-gradient(-45deg, #1f50dc, #4bbf73, #1f50dc, #4bbf73);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

/* Light mode adjustment */
[data-theme="light"] .header:not(.inverted) {
  background: linear-gradient(-45deg, #1f50dc, #4bbf73, #1f50dc, #4bbf73);
  background-size: 400% 400%;
  animation: gradient-shift 15s ease infinite;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .header {
    animation: none !important;
    background-position: 0% 50% !important;
  }
}

body.modal-open {
  overflow: hidden !important;
}
