/* Programming Page Specific Styles */

/* Hero Section */
.programming-page {
  padding-top: 2rem;
}

.hero-section {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeIn 1s ease-out;
}

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

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: #d1d5db;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-tab::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.2), transparent);
  transition: all 0.6s ease;
}

.nav-tab:hover::before {
  left: 100%;
}

.nav-tab:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  color: white;
}

.nav-tab.active {
  background-color: rgba(56, 189, 248, 0.2);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.nav-tab svg {
  transition: transform 0.3s ease;
}

.nav-tab:hover svg {
  transform: scale(1.2);
}

/* Search and Filter Section */
.search-filter-container {
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 1200px;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  width: 100%;
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.search-box svg {
  color: var(--primary-color);
}

.search-box input {
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  width: 100%;
  outline: none;
}

.search-box input::placeholder {
  color: #9ca3af;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: bold;
  white-space: nowrap;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-tag {
  background-color: rgba(56, 189, 248, 0.1);
  color: #d1d5db;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.filter-tag:hover {
  background-color: rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

.filter-tag.active {
  background-color: var(--primary-color);
  color: black;
}

/* Content Sections */
.content-section {
  display: none;
  width: 100%;
  animation: fadeIn 0.5s ease-out;
}

.content-section.active {
  display: block;
}

.section-header {
  margin-bottom: 2rem;
  text-align: center;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: #9ca3af;
  font-size: 1rem;
}

/* Projects Grid with Enhanced Animations */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
}

@media (min-width: 768px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.project-card {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
}

.project-card.animate {
  animation: fadeInUp 0.8s forwards;
}

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

.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4), 0 0 30px rgba(56, 189, 248, 0.3);
  z-index: 2;
}

.project-image {
  width: 100%;
  height: 180px;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.project-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.2) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.project-card:hover .project-image::before {
  opacity: 1;
}

.project-image svg {
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.7));
  transition: all 0.5s ease;
}

.project-card:hover .project-image svg {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.9));
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  position: relative;
  display: inline-block;
}

.project-title::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.project-card:hover .project-title::after {
  width: 100%;
}

.project-description {
  color: #d1d5db;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* Project files section */
.project-files {
  margin-top: 1rem;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: left;
  border: 1px solid rgba(56, 189, 248, 0.1);
  transition: all 0.3s ease;
}

.project-card:hover .project-files {
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.1);
}

.files-heading {
  font-size: 0.875rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.files-list {
  list-style: none;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #d1d5db;
  padding: 0.25rem 0;
  transition: all 0.3s ease;
}

.file-item:hover {
  color: white;
  transform: translateX(5px);
}

.file-item svg {
  color: var(--primary-color);
  opacity: 0.7;
  transition: all 0.3s ease;
}

.file-item:hover svg {
  opacity: 1;
  transform: rotate(5deg);
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-tag {
  background-color: rgba(56, 189, 248, 0.1);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.project-tag:hover {
  background-color: rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

/* Download button */
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--primary-color);
  color: #000000;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: bold;
  text-decoration: none;
  margin-top: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.download-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.6s ease;
  z-index: -1;
}

.download-button:hover::before {
  left: 100%;
}

.download-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(56, 189, 248, 0.5);
}

.download-button:active {
  transform: translateY(-1px);
}

/* Code Examples Grid with Enhanced Animations */
.code-examples-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
}

@media (min-width: 768px) {
  .code-examples-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .code-examples-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Code Card Styles with Enhanced Animations */
.code-card {
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  opacity: 0;
  transform: translateY(30px);
}

.code-card.animate {
  animation: fadeInUp 0.8s forwards;
}

.code-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4), 0 0 30px rgba(56, 189, 248, 0.3);
  z-index: 2;
}

.code-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.code-card:hover .code-card-header {
  background-color: rgba(56, 189, 248, 0.1);
}

.code-title {
  font-size: 1.125rem;
  font-weight: bold;
  color: var(--primary-color);
  margin: 0;
  position: relative;
  display: inline-block;
}

.code-title::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.code-card:hover .code-title::after {
  width: 100%;
}

.code-language-badge {
  background-color: var(--primary-color);
  color: #000000;
  padding: 0.25rem 0.75rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

.code-card:hover .code-language-badge {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.code-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.code-card:hover .code-tags {
  background-color: rgba(0, 0, 0, 0.4);
}

.code-tag {
  background-color: rgba(56, 189, 248, 0.1);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.code-tag:hover {
  background-color: rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.code-preview {
  padding: 1rem;
  background-color: rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  max-height: 150px;
}

.code-card:hover .code-preview {
  background-color: rgba(0, 0, 0, 0.4);
}

.code-preview::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  pointer-events: none;
}

.code-preview-content {
  font-family: "Fira Code", monospace;
  font-size: 0.875rem;
  color: #d1d5db;
  white-space: pre-wrap;
  text-align: left;
  line-height: 1.5;
}

.code-actions {
  display: flex;
  justify-content: space-between;
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.code-card:hover .code-actions {
  background-color: rgba(56, 189, 248, 0.05);
}

.view-code-btn,
.copy-code-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.view-code-btn::before,
.copy-code-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.2), transparent);
  transition: all 0.6s ease;
  z-index: -1;
}

.view-code-btn:hover::before,
.copy-code-btn:hover::before {
  left: 100%;
}

.view-code-btn:hover,
.copy-code-btn:hover {
  background-color: rgba(56, 189, 248, 0.1);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.view-code-btn:active,
.copy-code-btn:active {
  transform: translateY(-1px);
}

/* No Results Message */
.no-results-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--border-color);
  border-radius: 0.75rem;
  margin: 2rem 0;
}

.no-results-message svg {
  color: var(--primary-color);
  margin-bottom: 1rem;
  opacity: 0.7;
}

.no-results-message h3 {
  color: white;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.no-results-message p {
  color: #9ca3af;
}

/* Enhanced Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
}

.modal-content {
  background-color: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(56, 189, 248, 0.3);
}

.modal-content.show {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-header h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin: 0;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.close-modal {
  font-size: 1.75rem;
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  color: var(--primary-hover);
  background-color: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.modal-language {
  background-color: var(--primary-color);
  color: #000000;
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0 0 0.5rem 0.5rem;
  font-size: 0.875rem;
  font-weight: bold;
  position: absolute;
  top: 0;
  right: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid var(--border-color);
}

.code-block-wrapper {
  padding: 1.25rem;
  max-height: 70vh;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.2);
}

.modal-code-block {
  position: relative;
  margin: 0;
  padding: 1.5rem;
  border-radius: 0.5rem;
  background-color: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.1);
}

.modal-code-block pre {
  font-family: "Fira Code", monospace;
  font-size: 0.875rem;
  color: #d1d5db;
  white-space: pre-wrap;
  text-align: left;
  overflow-x: auto;
  line-height: 1.6;
}

/* Enhanced Copy Button */
.copy-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background-color: var(--primary-color);
  color: #000000;
  border: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.copy-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(56, 189, 248, 0.5);
}

.copy-button:active {
  transform: translateY(0);
}

/* Animations for staggered loading */
.project-card:nth-child(1),
.code-card:nth-child(1) {
  animation-delay: 0.1s;
}

.project-card:nth-child(2),
.code-card:nth-child(2) {
  animation-delay: 0.2s;
}

.project-card:nth-child(3),
.code-card:nth-child(3) {
  animation-delay: 0.3s;
}

.project-card:nth-child(4),
.code-card:nth-child(4) {
  animation-delay: 0.4s;
}

.project-card:nth-child(5),
.code-card:nth-child(5) {
  animation-delay: 0.5s;
}

.project-card:nth-child(6),
.code-card:nth-child(6) {
  animation-delay: 0.6s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .search-filter-container {
    flex-direction: column;
  }

  .nav-tabs {
    flex-direction: column;
    align-items: center;
  }

  .nav-tab {
    width: 100%;
    justify-content: center;
  }
}

/* Custom scrollbar for code blocks */
.code-block-wrapper::-webkit-scrollbar {
  width: 8px;
}

.code-block-wrapper::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.code-block-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #38bdf8, #0284c7);
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.3);
}

.code-block-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #0ea5e9, #0369a1);
}