/**
 * UI Components Styling for Fondation pour la promotion des droits website
 * Modern styling for tabs, cards, forms, and other UI components
 */

/* ===== Tabs ===== */
.tab-system {
  margin-bottom: 3rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.nav-tabs {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark) 100%);
  border: none;
  padding: 0.5rem 0.5rem 0;
  border-radius: 0.5rem 0.5rem 0 0;
}

.nav-tabs .nav-item {
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}

.nav-tabs .nav-link {
  color: rgba(255, 255, 255, 0.8);
  border: none;
  font-weight: 500;
  padding: 0.8rem 1.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-tabs .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background-color: #fff;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav-tabs .nav-link:hover {
  color: #fff;
}

.nav-tabs .nav-link:hover::before {
  width: 80%;
}

.nav-tabs .nav-link.active {
  color: var(--bs-dark);
  background-color: #fff;
  border: none;
  font-weight: 600;
}

.nav-tabs .nav-link.active::before {
  width: 0;
}

.tab-content {
  background-color: #fff;
  border-radius: 0 0 0.5rem 0.5rem;
  padding: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-top: none;
}

.tab-pane {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

.tab-pane.show.active {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Cards ===== */
.resource-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  border-radius: 0.75rem;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.card-img-top {
  height: 180px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.resource-card:hover .card-img-top {
  transform: scale(1.05);
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--bs-primary);
  position: relative;
  padding-bottom: 0.5rem;
}

.card-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-primary-light) 100%);
  transition: width 0.3s ease;
}

.resource-card:hover .card-title::after {
  width: 80px;
}

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

.card-footer {
  background-color: transparent;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.5rem;
}

.badge-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.35em 0.65em;
  border-radius: 0.25rem;
  margin-right: 0.5rem;
}

.badge-thematique {
  background-color: #e3f2fd;
  color: #0d47a1;
}

.badge-loi {
  background-color: #e8f5e9;
  color: #1b5e20;
}

.badge-etude {
  background-color: #fff8e1;
  color: #ff6f00;
}

.badge-multimedia {
  background-color: #f3e5f5;
  color: #6a1b9a;
}

/* ===== Task Management ===== */
.task-manager {
  background-color: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  margin-bottom: 2rem;
}

.task-manager-header {
  background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-primary-dark) 100%);
  color: #fff;
  padding: 1.5rem;
  position: relative;
}

.task-manager-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.task-manager-subtitle {
  font-weight: 400;
  opacity: 0.9;
  font-size: 0.9rem;
}

.task-form {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.task-input-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.task-input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.task-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.task-list-container {
  padding: 1.5rem;
}

.task-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.task-filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 2rem;
  background-color: transparent;
  color: var(--bs-gray-700);
  font-weight: 500;
  transition: all 0.3s ease;
}

.task-filter-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

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

.task-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.task-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
  transform-origin: center;
  animation: scaleIn 0.3s ease;
}

.task-item:hover {
  background-color: #f1f3f5;
}

.task-checkbox {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--bs-primary);
  border-radius: 50%;
  margin-right: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
}

.task-checkbox:checked {
  background-color: var(--bs-primary);
}

.task-checkbox:checked::after {
  content: '✓';
  color: #fff;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
}

.task-content {
  flex: 1;
  padding-right: 1rem;
}

.task-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: all 0.3s ease;
}

.task-description {
  font-size: 0.85rem;
  color: var(--bs-gray-600);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

.task-category,
.task-date {
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--bs-gray-700);
}

.task-delete {
  background: none;
  border: none;
  color: var(--bs-danger);
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.task-delete:hover {
  opacity: 1;
}

.task-item.completed .task-title {
  text-decoration: line-through;
  color: var(--bs-gray-500);
}

.task-item.completed .task-description {
  color: var(--bs-gray-500);
}

/* Empty task message */
.empty-tasks {
  text-align: center;
  padding: 2rem;
  color: var(--bs-gray-500);
}

.empty-tasks-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* ===== Search Section ===== */
.search-section {
  background-color: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.search-title {
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--bs-primary);
  position: relative;
  padding-bottom: 0.5rem;
}

.search-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-primary-light) 100%);
}

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

.search-input-group {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-left: 2.5rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bs-gray-500);
}

.search-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23212529' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  transition: all 0.3s ease;
}

.search-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.search-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* ===== Form Elements ===== */
.form-floating {
  position: relative;
}

.form-floating > .form-control {
  height: calc(3.5rem + 2px);
  padding: 1rem 0.75rem;
}

.form-floating > label {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  padding: 1rem 0.75rem;
  pointer-events: none;
  border: 1px solid transparent;
  transform-origin: 0 0;
  transition: opacity .1s ease-in-out, transform .1s ease-in-out;
  color: var(--bs-gray-600);
}

.form-floating > .form-control:focus,
.form-floating > .form-control:not(:placeholder-shown) {
  padding-top: 1.625rem;
  padding-bottom: 0.625rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  opacity: .65;
  transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
  color: var(--bs-primary);
}

.input-focused {
  position: relative;
}

.input-focused::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-primary-light) 100%);
  animation: scaleIn 0.3s ease;
}

/* Button ripple effect */
.btn {
  position: relative;
  overflow: hidden;
}

.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.7);
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  animation: ripple 0.6s linear;
  transform: scale(0);
  opacity: 1;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ===== Notification System ===== */
.notification-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 320px;
}

.notification {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  transform: translateX(100%);
}

.notification-icon {
  font-size: 1.25rem;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.notification-info .notification-icon {
  background-color: #e3f2fd;
  color: #0d47a1;
}

.notification-success .notification-icon {
  background-color: #e8f5e9;
  color: #1b5e20;
}

.notification-warning .notification-icon {
  background-color: #fff8e1;
  color: #ff6f00;
}

.notification-error .notification-icon {
  background-color: #fbe9e7;
  color: #c62828;
}

.notification-content {
  flex: 1;
}

.notification-content p {
  margin: 0;
  font-size: 0.9rem;
}

.notification-close {
  background: none;
  border: none;
  color: var(--bs-gray-500);
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

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

.fade-out-right {
  animation: fadeOutRight 0.3s ease forwards;
}

@keyframes fadeOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* ===== Scroll Progress Bar ===== */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bs-primary) 0%, var(--bs-primary-light) 100%);
  z-index: 9999;
  width: 0;
  transition: width 0.1s ease;
}

/* ===== Back to top button ===== */
.back-to-top-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background-color: var(--bs-primary);
  color: #fff;
  border: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
  z-index: 999;
}

.back-to-top-btn.visible {
  transform: scale(1);
  opacity: 1;
}

.back-to-top-btn:hover {
  background-color: var(--bs-primary-dark);
}

/* ===== Scrollbar styling ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
  background: var(--bs-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bs-primary-dark);
}

/* ===== Media Queries ===== */
@media (max-width: 768px) {
  .tab-system {
    margin-bottom: 2rem;
  }
  
  .nav-tabs .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .tab-content {
    padding: 1.5rem;
  }
  
  .task-input-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .notification-container {
    max-width: 280px;
    right: 1rem;
  }
  
  .back-to-top-btn {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (max-width: 576px) {
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
  }
  
  .nav-tabs .nav-item {
    flex-shrink: 0;
  }
  
  .search-form {
    grid-template-columns: 1fr;
  }
  
  .search-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .notification-container {
    left: 1rem;
    right: 1rem;
    max-width: calc(100% - 2rem);
  }
} 