/* projects */
#projects {
  padding: 4rem 0;
  min-height: 800px;
}

/* swap container */
.card-swap-container {
  position: relative;
  perspective: 900px;
  overflow: visible;
  margin: 4rem auto 0;
  min-height: 600px;
}

/* cards */
.project-card {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: #000;
  transform-style: preserve-3d;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.project-card:hover {
  border-color: #60a5fa;
  box-shadow: 0 0 30px rgba(96, 165, 250, 0.4), 0 0 60px rgba(96, 165, 250, 0.2);
  filter: brightness(1.2);
}

.card-content {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 16, 32, 0.3), rgba(11, 16, 32, 0.95));
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: white;
}

.card-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #60a5fa;
  font-family: 'Lora', serif;
}

.card-subtitle {
  font-size: 0.875rem;
  color: #94a3b8;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.card-description {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: #e2e8f0;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #60a5fa;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  width: fit-content;
}

.card-link:hover {
  color: #93c5fd;
  transform: translateX(4px);
}

/* badge location */
.about-me__location {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 2rem;
  color: #60a5fa;
  font-size: 0.9rem;
  margin-top: 1rem;
  transition: all 0.3s ease;
}

.about-me__location:hover {
  background: rgba(96, 165, 250, 0.2);
  border-color: rgba(96, 165, 250, 0.5);
  transform: translateY(-2px);
}

.about-me__location i {
  font-size: 1rem;
}

.location-text {
  font-weight: 500;
}

/* ----> next project button */
.next-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: rgba(96, 165, 250, 0.15);
  border: 2px solid #60a5fa;
  color: #60a5fa;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

.next-project-btn:hover {
  background: rgba(96, 165, 250, 0.25);
  border-color: #93c5fd;
  color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(96, 165, 250, 0.3);
}

.next-project-btn:active {
  transform: translateY(0);
}

.next-project-btn i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.next-project-btn:hover i {
  transform: translateX(4px);
}

.btn-text {
  font-family: inherit;
}

/* project detail moodal */
.project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 16, 32, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10000;
  overflow-y: auto;
  overflow-x: hidden;
  animation: fadeIn 0.3s ease;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.project-modal.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 100vh;
}

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

.modal-content {
  background: linear-gradient(135deg, rgba(30, 35, 58, 0.95), rgba(11, 16, 32, 0.95));
  border: 2px solid rgba(96, 165, 250, 0.3);
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease;
  margin: auto;
  overflow: hidden;
}

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

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(96, 165, 250, 0.5);
  background: rgba(11, 16, 32, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 20;
  backdrop-filter: blur(10px);
}

.modal-close:hover {
  background: rgba(96, 165, 250, 0.2);
  border-color: #60a5fa;
  transform: rotate(90deg);
}

.modal-close i {
  font-size: 1.2rem;
  color: #60a5fa;
}

/* aspect ratio elements */
.modal-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  object-position: center;
  background: rgba(11, 16, 32, 0.5);
  display: block;
  border-radius: 20px 20px 0 0;
}

.modal-body {
  padding: 2rem;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

.modal-title {
  font-size: 2rem;
  font-weight: 700;
  color: #60a5fa;
  margin-bottom: 0.5rem;
  font-family: 'Lora', serif;
  line-height: 1.2;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.modal-description {
  font-size: 1rem;
  line-height: 1.8;
  color: #e2e8f0;
  margin-bottom: 2rem;
}

.modal-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.detail-item {
  background: rgba(96, 165, 250, 0.05);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 12px;
  padding: 1.25rem;
}

.detail-label {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.detail-value {
  font-size: 0.95rem;
  color: #e2e8f0;
  font-weight: 500;
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.tag {
  padding: 0.5rem 1rem;
  background: rgba(96, 165, 250, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 2rem;
  color: #60a5fa;
  font-size: 0.875rem;
  font-weight: 500;
}

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

.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: rgba(96, 165, 250, 0.15);
  border: 2px solid #60a5fa;
  color: #60a5fa;
  border-radius: 2rem;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}

.modal-btn:hover {
  background: #60a5fa;
  color: #0b1020;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(96, 165, 250, 0.3);
}

.modal-btn i {
  font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .card-swap-container {
    transform: scale(0.75);
  }
  
  .card-title {
    font-size: 1.5rem;
  }
  
  .card-description {
    font-size: 0.875rem;
  }

  .card-overlay {
    padding: 1.5rem;
  }

  .about-me__location {
    font-size: 0.85rem;
  }

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

  .btn-text {
    display: inline;
  }

  /* Modal adjustments for tablets */
  .project-modal.active {
    padding: 1.5rem 1rem;
  }

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

  .modal-image {
    max-height: 400px;
  }

  .modal-body {
    padding: 1.75rem;
  }

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

  .modal-subtitle {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .card-swap-container {
    transform: scale(0.55);
  }
  
  .card-overlay {
    padding: 1rem;
  }

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

  .card-subtitle {
    font-size: 0.75rem;
  }

  .card-description {
    font-size: 0.75rem;
    margin-bottom: 1rem;
  }

  .about-me__location {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .next-project-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .btn-text {
    display: none;
  }

  /* Mobile modal improvements */
  .project-modal.active {
    padding: 1rem 0.5rem;
    align-items: flex-start;
  }

  .modal-content {
    max-width: 100%;
    border-radius: 16px;
    margin: 0.5rem;
  }

  .modal-image {
    max-height: 300px;
    border-radius: 16px 16px 0 0;
  }

  .modal-body {
    padding: 1.5rem;
  }

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

  .modal-subtitle {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }

  .modal-description {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .modal-details {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .detail-item {
    padding: 1rem;
  }

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

  .modal-btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1.5rem;
  }

  .modal-close {
    width: 36px;
    height: 36px;
    top: 1rem;
    right: 1rem;
  }

  .modal-close i {
    font-size: 1rem;
  }
}

/* Additional fixes for very tall modals */
@media (max-height: 700px) {
  .modal-image {
    max-height: 250px;
  }

  .modal-body {
    padding: 1.5rem;
  }

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

/* Landscape mobile */
@media (max-width: 900px) and (max-height: 500px) {
  .modal-content {
    max-height: none;
  }

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

  .modal-body {
    padding: 1.5rem;
  }
}