/* ============================================ */
/* ===        PORTFOLIO PAGE STYLES        === */
/* ============================================ */

/* Portfolio Controls Section */
.portfolio-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

/* Search Bar */
.portfolio-search-bar {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.portfolio-search-bar input {
  width: 100%;
  padding: 14px 20px 14px 50px;
  border-radius: 50px;
  border: 1px solid var(--border-color, #444);
  background-color: var(--card-bg, #1a1a1a);
  color: var(--light-text, #e0e0e0);
  font-size: 1em;
  font-family: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-search-bar input:focus {
  outline: none;
  border-color: var(--primary-color, #00aaff);
  box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.1);
}

.portfolio-search-bar input::placeholder {
  color: var(--dark-text, #999);
}

.portfolio-search-bar .fa-search {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dark-text, #999);
  pointer-events: none;
}

/* Filter Row */
.filter-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-row select {
  min-width: 180px;
}

/* Portfolio Grid - More Compact */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

/* Project Card */
.project-card {
  background-color: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border-color, #444);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 170, 255, 0.2);
  border-color: var(--primary-color, #00aaff);
}

/* Featured Badge */
.featured-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #f7b733, #fc4a1a);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: bold;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.featured-badge i {
  font-size: 0.9em;
}

/* Project Image Section - Smaller */
.project-image-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background-color: #000;
}

.project-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-thumbnail {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.btn-view-details {
  background-color: var(--primary-color, #00aaff);
  color: var(--dark-bg, #000);
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 0.95em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 170, 255, 0.3);
}

.btn-view-details:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 170, 255, 0.4);
}

.btn-view-details i {
  font-size: 1em;
}

/* Project Info Section - More Compact */
.project-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

/* Project Header */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.project-title {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--light-text, #e0e0e0);
  margin: 0;
  flex: 1;
  line-height: 1.3;
}

/* Status Badge */
.project-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: bold;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-completed {
  background-color: rgba(40, 167, 69, 0.2);
  color: #28a745;
  border: 1px solid #28a745;
}

.status-in-progress {
  background-color: rgba(255, 193, 7, 0.2);
  color: #ffc107;
  border: 1px solid #ffc107;
}

.status-planned {
  background-color: rgba(108, 117, 125, 0.2);
  color: #6c757d;
  border: 1px solid #6c757d;
}

/* Project Description - Smaller */
.project-description {
  font-size: 0.9em;
  line-height: 1.5;
  color: var(--dark-text, #999);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* Project Category */
.project-category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: var(--primary-color, #00aaff);
  font-weight: 600;
}

.project-category i {
  font-size: 0.95em;
}

/* Technology Stack Badges */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 5px;
}

.tech-badge {
  background-color: rgba(0, 170, 255, 0.1);
  border: 1px solid var(--primary-color, #00aaff);
  color: var(--primary-color, #00aaff);
  padding: 4px 10px;
  border-radius: 15px;
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.tech-badge:hover {
  background-color: rgba(0, 170, 255, 0.2);
  transform: scale(1.05);
}

.tech-badge.more {
  background-color: var(--border-color, #444);
  border-color: var(--border-color, #444);
  color: var(--dark-text, #999);
}

/* Project Links */
.project-links {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.project-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9em;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

.project-link i {
  font-size: 1em;
}

.project-link.live {
  background-color: transparent;
  border: 1px solid var(--primary-color, #00aaff);
  color: var(--primary-color, #00aaff);
}

.project-link.live:hover {
  background-color: var(--primary-color, #00aaff);
  color: var(--dark-bg, #000);
  box-shadow: 0 4px 12px rgba(0, 170, 255, 0.3);
}

.project-link.github {
  background-color: transparent;
  border: 1px solid var(--light-text, #e0e0e0);
  color: var(--light-text, #e0e0e0);
}

.project-link.github:hover {
  background-color: var(--light-text, #e0e0e0);
  color: var(--dark-bg, #000);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Reaction Buttons in Project Card */
.project-card .reaction-buttons {
  display: flex;
  gap: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color, #444);
  margin-top: auto;
}

.project-card .reaction-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background-color: transparent;
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  color: var(--dark-text, #999);
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.project-card .reaction-btn:hover {
  border-color: var(--primary-color, #00aaff);
  color: var(--primary-color, #00aaff);
  background-color: rgba(0, 170, 255, 0.1);
}

.project-card .reaction-btn.active {
  border-color: var(--primary-color, #00aaff);
  color: var(--primary-color, #00aaff);
  background-color: rgba(0, 170, 255, 0.2);
}

.project-card .reaction-btn i {
  font-size: 1em;
}

.project-card .reaction-btn span {
  font-weight: 600;
}

/* No Results State */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--dark-text, #999);
}

.no-results i {
  font-size: 4em;
  margin-bottom: 20px;
  opacity: 0.5;
  color: var(--dark-text, #999);
}

.no-results p {
  font-size: 1.2em;
  margin-bottom: 20px;
  color: var(--light-text, #e0e0e0);
}

.btn-reset {
  background-color: var(--primary-color, #00aaff);
  color: var(--dark-bg, #000);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 170, 255, 0.3);
}

.btn-reset:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 170, 255, 0.4);
}

/* ============================================ */
/* ===        RESPONSIVE BREAKPOINTS       === */
/* ============================================ */

/* Tablet (1024px and below) */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
  }

  .project-title {
    font-size: 1.2em;
  }

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

/* Mobile (768px and below) */
@media (max-width: 768px) {
  .portfolio-controls {
    gap: 15px;
  }

  .portfolio-search-bar {
    max-width: 100%;
  }

  .portfolio-search-bar input {
    padding: 12px 20px 12px 45px;
    font-size: 0.95em;
  }

  .portfolio-search-bar .fa-search {
    left: 15px;
  }

  .filter-row {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .filter-row select {
    width: 100%;
    min-width: auto;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
  }

  .project-card {
    max-width: 100%;
    margin: 0 auto;
  }

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

  .project-title {
    font-size: 1.15em;
  }

  .project-info {
    padding: 15px;
  }

  .project-links {
    flex-direction: column;
  }

  .project-link {
    width: 100%;
  }

  .featured-badge {
    top: 10px;
    right: 10px;
    font-size: 0.8em;
    padding: 5px 10px;
  }

  .tech-stack {
    gap: 6px;
  }

  .tech-badge {
    font-size: 0.75em;
    padding: 3px 8px;
  }
}

/* Small Mobile (600px and below) */
@media (max-width: 600px) {
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .project-status {
    align-self: flex-start;
  }

  .btn-view-details {
    padding: 10px 20px;
    font-size: 0.9em;
  }

  .no-results {
    padding: 40px 15px;
  }

  .no-results i {
    font-size: 3em;
  }

  .no-results p {
    font-size: 1em;
  }
}

/* Very Small Mobile (400px and below) */
@media (max-width: 400px) {
  .portfolio-search-bar input {
    padding: 10px 15px 10px 40px;
    font-size: 0.9em;
  }

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

  .project-title {
    font-size: 1.1em;
  }

  .project-description {
    font-size: 0.9em;
  }

  .project-category {
    font-size: 0.85em;
  }

  .tech-badge {
    font-size: 0.7em;
  }

  .project-link {
    font-size: 0.85em;
    padding: 8px 12px;
  }
}

/* ============================================ */
/* ===        PROJECT DETAIL MODAL         === */
/* ============================================ */

.project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
}

.project-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.project-modal-content {
  background-color: var(--card-bg, #1a1a1a);
  border: 1px solid var(--border-color, #444);
  border-radius: 12px;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.4s ease;
}

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

.modal-close-btn {
  position: sticky;
  top: 10px;
  right: 10px;
  float: right;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color, #444);
  color: var(--light-text, #e0e0e0);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  margin: 10px;
}

.modal-close-btn:hover {
  background-color: var(--primary-color, #00aaff);
  color: var(--dark-bg, #000);
  transform: rotate(90deg);
}

#project-modal-body {
  padding: 30px;
  clear: both;
}

/* Modal Header */
.modal-project-header {
  margin-bottom: 30px;
  border-bottom: 2px solid var(--primary-color, #00aaff);
  padding-bottom: 20px;
}

.modal-project-title {
  font-size: 2em;
  font-weight: 700;
  color: var(--light-text, #e0e0e0);
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.modal-project-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 15px;
}

.modal-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.modal-badge.category {
  background-color: rgba(0, 170, 255, 0.2);
  color: var(--primary-color, #00aaff);
  border: 1px solid var(--primary-color, #00aaff);
}

/* Modal Description */
.modal-description {
  font-size: 1.1em;
  line-height: 1.8;
  color: var(--dark-text, #999);
  margin: 20px 0;
  white-space: pre-line;
}

/* Modal Tech Stack */
.modal-tech-section {
  margin: 25px 0;
}

.modal-section-title {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--light-text, #e0e0e0);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-section-title i {
  color: var(--primary-color, #00aaff);
}

.modal-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.modal-tech-item {
  background-color: rgba(0, 170, 255, 0.1);
  border: 1px solid var(--primary-color, #00aaff);
  color: var(--primary-color, #00aaff);
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9em;
}

/* Modal Links */
.modal-links {
  display: flex;
  gap: 15px;
  margin: 25px 0;
  flex-wrap: wrap;
}

.modal-link {
  flex: 1;
  min-width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1em;
  transition: all 0.3s ease;
}

.modal-link.primary {
  background-color: var(--primary-color, #00aaff);
  color: var(--dark-bg, #000);
  border: 1px solid var(--primary-color, #00aaff);
}

.modal-link.primary:hover {
  background-color: transparent;
  color: var(--primary-color, #00aaff);
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.3);
}

.modal-link.secondary {
  background-color: transparent;
  color: var(--light-text, #e0e0e0);
  border: 1px solid var(--light-text, #e0e0e0);
}

.modal-link.secondary:hover {
  background-color: var(--light-text, #e0e0e0);
  color: var(--dark-bg, #000);
}

/* Modal Image Gallery */
.modal-image-gallery {
  margin: 25px 0;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.gallery-item {
  position: relative;
  width: 100%;
  min-height: 200px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color, #444);
  background-color: #000;
  cursor: zoom-in;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 16px rgba(0, 170, 255, 0.3);
  border-color: var(--primary-color, #00aaff);
}

.gallery-item img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

/* Image Lightbox */
.image-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 99999;
  cursor: zoom-out;
  animation: fadeIn 0.3s ease;
}

.image-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.image-lightbox img {
  max-width: 95%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(0, 170, 255, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: var(--primary-color, #00aaff);
  color: var(--dark-bg, #000);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  z-index: 100000;
}

.lightbox-close:hover {
  transform: rotate(90deg) scale(1.1);
}

/* Modal Live Preview */
.modal-live-preview {
  margin: 30px 0;
  border: 2px solid var(--border-color, #444);
  border-radius: 12px;
  overflow: hidden;
  background-color: #000;
}

.modal-live-preview iframe {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

.preview-placeholder {
  padding: 60px 20px;
  text-align: center;
  color: var(--dark-text, #999);
}

.preview-placeholder i {
  font-size: 3em;
  margin-bottom: 15px;
  opacity: 0.5;
}

.preview-placeholder p {
  font-size: 1.1em;
  margin-bottom: 20px;
}

/* Modal Responsive */
@media (max-width: 768px) {
  .project-modal.active {
    padding: 10px;
  }

  #project-modal-body {
    padding: 20px 15px;
  }

  .modal-project-title {
    font-size: 1.5em;
  }

  .modal-description {
    font-size: 1em;
  }

  .modal-tech-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

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

  .modal-link {
    width: 100%;
  }

  .modal-live-preview iframe {
    height: 400px;
  }

  .modal-section-title {
    font-size: 1.1em;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item {
    min-height: 150px;
  }

  .gallery-item img {
    max-height: 250px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1.5em;
  }
}

/* ============================================ */
/* ===        LOADING STATE               === */
/* ============================================ */

.portfolio-grid > p {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--dark-text, #999);
  font-size: 1.1em;
}

/* ============================================ */
/* ===        ANIMATION ENHANCEMENTS       === */
/* ============================================ */

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

.project-card.animate-on-scroll {
  animation: fadeInUp 0.6s ease-out;
}

/* Stagger animation for grid items */
.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }
