/**
 * Custom CSS Styles for Buku Tamu Pintar
 * Enhances Bootstrap 5 with custom styling
 */

/* General Styles */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
}

/* Navbar Custom */
.navbar-brand {
  font-weight: 600;
  font-size: 1.3rem;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 3rem 0;
}

.hero h1 {
  color: white;
}

.hero .lead {
  color: rgba(255, 255, 255, 0.9);
}

/* Stats Cards */
.stats-cards .card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stats-cards .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Guestbook Form Card */
.sticky-top {
  position: sticky;
  z-index: 100;
}

/* Message Cards */
.message-card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeIn 0.5s ease-in;
}

.message-card:hover {
  transform: translateX(5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sentiment Badges */
.badge {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Admin Login Page */
#login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#login-page .card {
  border: none;
  border-radius: 1rem;
}

/* Admin Dashboard */
#dashboard-page .card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 1.5rem;
}

/* Admin Stats Cards */
#dashboard-page .card i {
  opacity: 0.3;
}

/* Admin Table */
.table-responsive {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
}

.table thead {
  background-color: #f8f9fa;
}

.table tbody tr {
  transition: background-color 0.2s;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Buttons */
.btn {
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Pagination */
.pagination .page-link {
  color: #667eea;
  border-radius: 0.5rem;
  margin: 0 0.25rem;
  border: 1px solid #dee2e6;
}

.pagination .page-link:hover {
  background-color: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination .page-item.active .page-link {
  background-color: #667eea;
  border-color: #667eea;
}

/* Footer */
footer {
  margin-top: auto;
}

/* Loading Spinner */
.spinner-border {
  width: 3rem;
  height: 3rem;
}

/* Alert Animations */
.alert {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal */
.modal-content {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
}

/* Character Counter */
.form-text {
  font-size: 0.875rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 0;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .stats-cards {
    margin-top: 2rem;
  }

  .sticky-top {
    position: relative;
  }

  .table {
    font-size: 0.875rem;
  }

  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1rem;
  }

  .display-4 {
    font-size: 2rem;
  }

  .card-body {
    padding: 1rem;
  }

  .btn {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Utility Classes */
.shadow-sm-hover {
  transition: box-shadow 0.2s;
}

.shadow-sm-hover:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.text-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  .pagination,
  footer {
    display: none !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #dee2e6 !important;
  }
}
