/* static/style.css */

/* ===== VARIABLES & RESET ===== */
:root {
  --primary: #2c3e50;
  --secondary: #7f8c8d;
  --danger: #e74c3c;
  --success: #27ae60;
  --info: #3498db;
  --light: #ecf0f1;
  --dark: #2c3e50;
  --border-radius: 0.375rem;
  --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

/* ===== TYPOGRAPHY ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--dark);
  font-weight: 600;
  line-height: 1.2;
}

a {
  text-decoration: none;
  transition: var(--transition);
}

small {
  font-size: 0.875rem;
}

.text-muted {
  color: #6c757d !important;
}

/* ===== LAYOUT & STRUCTURE ===== */
.min-vh-100 {
  min-height: 100vh;
}

.container {
  padding-left: 15px;
  padding-right: 15px;
}


/* Main Content */
main {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* Footer */
footer {
  background-color: var(--primary);
  color: white;
  font-size: 0.875rem;
}

footer a:hover {
  color: var(--light) !important;
  text-decoration: underline;
}

/* ===== CARD & FORM STYLING ===== */
.card {
  border: none;
  border-radius: var(--border-radius);
  overflow: hidden;
  background-color: white;
}

.shadow-sm {
  box-shadow: var(--box-shadow);
}

/* Drop Zone */
.border-dashed {
  border: 2px dashed #3498db !important;
  transition: var(--transition);
}

.border-dashed:hover {
  background-color: rgba(52, 152, 219, 0.05);
  border-color: #2980b9 !important;
}

/* Buttons */
.btn {
  font-weight: 500;
  border-radius: var(--border-radius);
  transition: var(--transition);
  padding: 0.5rem 1rem;
}

.btn-outline-primary {
  border-color: var(--info);
  color: var(--info);
}

.btn-outline-primary:hover {
  background-color: var(--info);
  color: white;
}

.btn-danger {
  background-color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background-color: #c0392b;
  border-color: #c0392b;
}

.btn-success {
  background-color: var(--success);
  border-color: var(--success);
}

.btn-success:hover {
  background-color: #219653;
  border-color: #219653;
}

/* Progress Bar */
.progress {
  height: 1.5rem;
  border-radius: var(--border-radius);
}

.progress-bar {
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Alerts */
.alert {
  border-radius: var(--border-radius);
  padding: 0.75rem 1.25rem;
}

/* File Info */
#fileInfo {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6 !important;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

/* ===== MOBILE OPTIMIZATION ===== */
@media (max-width: 768px) {

  /* Make main content area more compact */
  main {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
  }

  /* Adjust card padding on mobile */
  .card {
    padding: 1.5rem !important;
    margin-bottom: 1rem;
  }

  /* Make buttons more touch-friendly */
  .btn {
    padding: 0.6rem;
    font-size: 1rem;
  }

  /* Ensure CTA button is always visible */
  #submitBtn {
    position: sticky;
    bottom: 1rem;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  /* Reduce font sizes slightly */
  h1 {
    font-size: 1.5rem;
  }

  .text-muted {
    font-size: 0.8rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* ===== BRANDING ELEMENTS ===== */
/* Primary color accents */
.bg-primary {
  background-color: var(--primary) !important;
}

.text-primary {
  color: var(--primary) !important;
}

/* File icon colors */
.fa-file-word {
  color: #2b579a;
}

.fa-file-pdf {
  color: #e74c3c;
}

.fa-file-image {
  color: #27ae60;
}

/* ===== FORM ELEMENTS ===== */
.form-control,
.form-select {
  border-radius: var(--border-radius);
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

/* ===== SPECIAL EFFECTS ===== */
/* Hover effects for interactive elements */
.btn,
#dropZone,
a {
  cursor: pointer;
}

/* Loading state for buttons */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1.5rem;
  height: 1.5rem;
  margin: -0.75rem 0 0 -0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== ACCESSIBILITY ===== */
/* Focus styles for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Tambahkan ini ke style.css Anda */


/* Untuk memastikan konten tidak tertutup header */
main {
  padding-top: 2rem;
  /* Sesuaikan dengan tinggi header Anda */
}

/* ===== FOOTER STYLING ===== */
footer {
  background-color: var(--dark);
  color: white;
  padding: 2rem 0;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.footer-brand i {
  font-size: 1.5rem;
  margin-right: 0.5rem;
  color: var(--info);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.5rem;
  transition: var(--transition);
  border-radius: 4px;
}

.footer-links a:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.footer-divider {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.3);
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-divider {
    display: none;
  }

  footer {
    padding: 1.5rem 0;
  }
}

#historyLog {
  max-height: 200px;
  overflow-y: auto;
  border-top: 1px solid #eee;
  padding-top: 0.5rem;
}

#historyLog .text-truncate {
  font-weight: 500;
}

#previewContainer button {
  transition: 0.2s;
}

#previewContainer button:hover {
  background-color: #f8f9fa;
}

/* Gaya Utama Header */
header {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-bottom: none !important;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

header.scrolled {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(5px);
}

/* Logo dan Judul */
.navbar-brand span {
  letter-spacing: 0.5px;
  background: linear-gradient(to right, #0072ff, #00c6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.navbar-brand img {
  height: 36px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
  transition: filter 0.3s ease, transform 0.3s ease;
}

.navbar-brand:hover img {
  filter: drop-shadow(0 2px 4px rgba(0, 123, 255, 0.4));
  transform: rotate(-1deg) scale(1.05);
}

/* Link Navigasi */
.nav-link {
  position: relative;
  color: #4a5568 !important;
  font-weight: 500 !important;
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-link:hover {
  color: #4a6bff !important;
  background-color: rgba(74, 107, 255, 0.05);
  transform: translateY(-1px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #4a6bff 0%, #2b44d0 100%);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 60%;
}

.nav-link.active {
  color: #4a6bff !important;
  font-weight: 600 !important;
}

.nav-link.active::after {
  width: 60%;
}

/* Tombol Hamburger */
.navbar-toggler {
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.25rem;
  transition: all 0.3s ease;
}

.navbar-toggler:hover {
  background-color: rgba(74, 107, 255, 0.05);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile */
@media (max-width: 767.98px) {
  .navbar-collapse {
    flex-direction: column;
    align-items: flex-start;
    /* 👈 supaya rata kiri */
    padding: 1rem 0;
  }

  .nav-link {
    display: block;
    padding: 0.5rem 1rem;
    margin: 0.25rem 0;
    width: 100%;
    text-align: left;
    /* 👈 rata kiri */
  }

  .nav-link::after {
    display: none;
  }
}