/**
 * Modular CSS Components
 * Gonzaga's Art & Shine
 */

/* ===== UTILITY CLASSES ===== */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

.slide-up {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.6s ease forwards;
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-20px);
  animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
  opacity: 0;
  transform: translateX(20px);
  animation: slideInRight 0.6s ease forwards;
}

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

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

@keyframes slideInLeft {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== LOADING COMPONENTS ===== */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  border-top-color: var(--color-bronze);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 24, 16, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
  transition: opacity 0.3s ease;
}

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

.loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: var(--color-bronze);
}

/* ===== NOTIFICATION SYSTEM ===== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 300px;
  max-width: 500px;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.notification-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.notification-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
}

.notification-close {
  background: none;
  border: none;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.notification-close:hover {
  opacity: 1;
}

.notification-success {
  background: var(--color-success);
  color: white;
}

.notification-error {
  background: var(--color-danger);
  color: white;
}

.notification-warning {
  background: var(--color-warning);
  color: white;
}

.notification-info {
  background: var(--color-info);
  color: white;
}

/* ===== BACK TO TOP BUTTON (SMALL DESIGN) ===== */
#backToTopBtn,
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background: var(--color-silver);
  color: var(--color-primary);
  border: 2px solid rgba(192, 192, 192, 0.35);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 1020;
  box-shadow: 0 4px 15px rgba(192, 192, 192, 0.3), 
              0 0 0 0 rgba(192, 192, 192, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: 0;
  transform: translateY(20px) scale(0.8);
  overflow: hidden;
  position: relative;
}

#backToTopBtn::before,
.back-to-top::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: left 0.5s ease;
}

#backToTopBtn:hover::before,
.back-to-top:hover::before {
  left: 100%;
}

#backToTopBtn svg,
.back-to-top svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

#backToTopBtn .back-to-top-label,
.back-to-top .back-to-top-label {
  display: none; /* Hide label - button is small */
}

#backToTopBtn.visible,
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#backToTopBtn:hover,
.back-to-top:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 6px 20px rgba(192, 192, 192, 0.35), 
              0 0 0 6px rgba(192, 192, 192, 0.12);
  border-color: var(--color-silver);
}

#backToTopBtn:hover svg,
.back-to-top:hover svg {
  transform: translateY(-2px);
}

#backToTopBtn:active,
.back-to-top:active {
  transform: translateY(-2px) scale(1.02);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  #backToTopBtn,
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    /* Ensure it doesn't interfere with filter button */
    z-index: 1021;
  }
  
  #backToTopBtn svg,
  .back-to-top svg {
    width: 16px;
    height: 16px;
  }
  
  /* Hide when drawer is open to avoid conflicts */
  body.drawer-open #backToTopBtn,
  body.drawer-open .back-to-top {
    opacity: 0;
    pointer-events: none;
    transform: translateX(100px);
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 991px) {
  #backToTopBtn,
  .back-to-top {
    bottom: 25px;
    right: 25px;
    width: 44px;
    height: 44px;
  }
  
  #backToTopBtn svg,
  .back-to-top svg {
    width: 17px;
    height: 17px;
  }
}

/* ===== BUTTON COMPONENTS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 8px;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
  background: rgba(212, 175, 55, 0.1);
  color: var(--color-bronze);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--color-bronze);
}

.btn-outline {
  background: transparent;
  color: var(--color-bronze);
  border: 2px solid var(--color-bronze);
}

.btn-outline:hover {
  background: var(--color-bronze);
  color: var(--color-secondary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== CARD COMPONENTS ===== */
.card {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
}

.card-header {
  padding: 20px 24px 0;
}

.card-body {
  padding: 24px;
}

.card-footer {
  padding: 0 24px 20px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  margin-top: 20px;
  padding-top: 20px;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.card-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ===== MODAL COMPONENTS ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--color-secondary);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 16px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.visible .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 24px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--color-text);
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: var(--color-bronze);
}

.modal-body {
  padding: 24px;
  color: var(--color-text-muted);
}

.modal-footer {
  padding: 24px;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== FORM COMPONENTS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-bronze);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(44, 24, 16, 0.6);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 8px;
  color: var(--color-text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
}

.form-control::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-bronze);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
  background: rgba(44, 24, 16, 0.8);
}

.form-control:invalid {
  border-color: var(--color-danger);
}

.form-control:valid {
  border-color: var(--color-success);
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
  .notification {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
  }

  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 16px;
  }

  .modal {
    margin: 20px;
    max-width: none;
    width: calc(100% - 40px);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }

  .card-body {
    padding: 16px;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for accessibility */
.btn:focus,
.form-control:focus,
.notification-close:focus,
.modal-close:focus {
  outline: 2px solid var(--color-bronze);
  outline-offset: 2px;
} 