/* Components CSS - Reusable UI components */

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  color: #fff;
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-secondary {
  color: #fff;
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

/* Cards */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.25rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-img-top {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  flex: 1 1 auto;
  padding: 1.25rem;
}

.card-title {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.card-text {
  margin-bottom: 1rem;
  color: var(--gray);
}

/* Project Cards */
.project {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  height: 300px;
  background-size: cover;
  background-position: center;
  transition: all 0.3s ease;
}

.project:hover {
  transform: scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.project .overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.project .text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1rem 1rem;
  color: white;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s ease;
}

.project:hover .text {
  transform: translateY(0);
  opacity: 1;
}

.project h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.project h3 a {
  color: white;
  text-decoration: none;
}

.project h3 a:hover {
  color: var(--primary-color);
}

.project span {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Blog Cards */
.blog-entry {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-entry:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.blog-entry .block-20 {
  display: block;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.blog-entry .block-20::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-entry:hover .block-20::after {
  opacity: 1;
}

.blog-entry .text {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-entry .meta {
  font-size: 0.875rem;
  color: var(--gray);
  margin-bottom: 1rem;
}

.blog-entry .meta a {
  color: var(--primary-color);
  text-decoration: none;
}

.blog-entry .meta a:hover {
  text-decoration: underline;
}

.blog-entry .heading {
  margin: 0 0 1rem 0;
}

.blog-entry .heading a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.4;
}

.blog-entry .heading a:hover {
  color: var(--primary-color);
}

.blog-entry p {
  flex: 1;
  margin: 0;
  color: var(--gray);
  line-height: 1.6;
}

/* Navigation Toggle */
.navbar-toggler {
  padding: 0.25rem 0.75rem;
  font-size: 1.25rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  color: var(--white);
  cursor: pointer;
}

.navbar-toggler:hover,
.navbar-toggler:focus {
  text-decoration: none;
}

/* Form Components */
.form-group {
  margin-bottom: 1rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: #495057;
  background-color: #fff;
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.contact-inputs {
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.contact-inputs::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.contact-inputs:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 2px var(--primary-color);
}

/* Tech Stack Tags */
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tech-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-color);
  color: white;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tech-tag.secondary {
  background: var(--secondary-color);
}

.tech-tag.success {
  background: var(--success);
}

/* Lightbox Component */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: var(--primary-color);
}

/* Loading Spinner */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Scroll to Top Button */
#scroll {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

#scroll.show {
  opacity: 1;
  visibility: visible;
}

#scroll:hover {
  background: var(--secondary-color);
  transform: translateY(-3px);
}

/* Responsive Components */
@media (max-width: 768px) {
  .project {
    height: 250px;
  }
  
  .blog-entry .block-20 {
    height: 150px;
  }
  
  .tech-tags {
    justify-content: center;
  }
  
  #scroll {
    width: 40px;
    height: 40px;
    bottom: 15px;
    right: 15px;
  }
}

@media (max-width: 480px) {
  .card-body {
    padding: 1rem;
  }
  
  .blog-entry .text {
    padding: 1rem;
  }
  
  .contact-inputs {
    padding: 0.75rem;
  }
}
