/**
 * GuruSinergi Research Hub - Stylesheet Responsif
 * 
 * File ini berisi gaya responsif untuk aplikasi Research Hub
 * Dikembangkan untuk GuruSinergi Research Hub
 */

/* ===== BREAKPOINT KECIL (PONSEL) ===== */
@media (max-width: 576px) {
  /* Typography */
  h1 {
    font-size: 1.75rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
  }
  
  h4 {
    font-size: 1.125rem;
  }
  
  /* Spacing */
  .container {
    padding: 0 1rem;
  }
  
  /* Login & Register Pages */
  .login-form-container,
  .register-form-container {
    flex-direction: column;
    max-width: 100%;
  }
  
  .login-image,
  .register-image {
    display: none;
  }
  
  .login-form,
  .register-form {
    padding: 1.5rem;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .form-row > .form-group {
    padding-right: 0;
    padding-left: 0;
  }
  
  /* Navigation */
  .navbar {
    padding: 0.75rem 1rem;
  }
  
  .navbar-brand {
    font-size: 1.125rem;
  }
  
  .navbar-brand img {
    height: 1.5rem;
  }
  
  /* Cards & Grids */
  .card-list {
    grid-template-columns: 1fr;
  }
  
  /* Research Hub features */
  .research-hub-header {
    padding: 2rem 0;
  }
  
  .research-hub-header h1 {
    font-size: 1.75rem;
  }
  
  .research-hub-header p {
    font-size: 1rem;
  }
  
  .research-hub-features {
    padding: 2rem 0;
  }
  
  /* Search Results */
  .result-card {
    flex-direction: column;
  }
  
  /* Collaboration */
  .collaboration-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .collaboration-tags {
    justify-content: center;
  }
  
  .collaboration-status {
    justify-content: center;
  }
  
  /* Plagiarism Results */
  .plagiarism-result {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ===== BREAKPOINT MEDIUM (TABLET) ===== */
@media (min-width: 577px) and (max-width: 768px) {
  /* Typography */
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  /* Login & Register Pages */
  .login-form-container,
  .register-form-container {
    max-width: 90%;
  }
  
  /* Cards & Grids */
  .card-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Research Hub features */
  .feature-item {
    flex: 0 0 50%;
    max-width: 50%;
  }
  
  /* Collaboration */
  .collaboration-avatar {
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
  }
}

/* ===== BREAKPOINT LARGE (LAPTOP) ===== */
@media (min-width: 769px) and (max-width: 992px) {
  /* Cards & Grids */
  .card-list {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Research Hub features */
  .feature-item {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
  }
}

/* ===== BREAKPOINT XLARGE (DESKTOP) ===== */
@media (min-width: 993px) and (max-width: 1200px) {
  /* Cards & Grids */
  .card-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== SEMUA PERANGKAT SELULER ===== */
@media (max-width: 768px) {
  /* Navigation */
  /* Tampilkan tombol toggle di mobile */
  .navbar-toggler {
    display: block;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-dark);
    cursor: pointer;
    padding: 0.25rem;
  }
  
  /* Posisikan navbar-collapse di mobile sebagai panel offcanvas */
  .navbar-collapse {
    position: fixed;
    top: 0;
    left: -100%;
    bottom: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    padding: 1.5rem 1rem;
    background-color: white;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    display: block !important;
  }
  
  /* Saat navbar terbuka */
  .navbar-collapse.show {
    left: 0;
  }
  
  /* Navbar Overlay (background gelap saat menu terbuka) */
  .navbar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  
  .navbar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  
  /* Header panel navbar-collapse */
  .navbar-collapse-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  /* Tombol close */
  .navbar-collapse-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-dark);
    cursor: pointer;
  }
  
  /* Tampilan menu navigation */
  .navbar-nav {
    flex-direction: column;
    display: flex;
    margin: 0;
    padding: 0;
  }
  
  .nav-item {
    margin: 0.5rem 0;
  }
  
  .nav-link {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-radius: 0.375rem;
  }
  
  .nav-link i {
    margin-right: 0.75rem;
    width: 1.25rem;
    text-align: center;
  }
  
  /* Page Layout */
  .row {
    flex-direction: column;
  }
  
  .sidebar {
    position: static;
    height: auto;
    padding-right: 0;
    margin-bottom: 1.5rem;
  }
  
  /* Search Form */
  .search-form {
    width: 100%;
  }
  
  /* Tables */
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Auth Pages */
  .auth-container {
    flex-direction: column;
  }
  
  .auth-left {
    display: none;
  }
  
  /* Sembunyikan nama user pada mobile */
  .user-name {
    display: none;
  }
  
  /* Tampilan tombol login/register pada mobile */
  .navbar-right .btn {
    padding: 0.375rem;
  }
}

/* ===== DESKTOP DAN TABLET HORIZONTAL ===== */
@media (min-width: 769px) {
  /* Navigasi Desktop - tampilkan secara horizontal */
  .navbar-toggler,
  .navbar-collapse-header,
  .navbar-collapse-close {
    display: none !important;
  }
  
  .navbar-collapse {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    background-color: transparent;
    box-shadow: none;
    overflow: visible;
  }
  
  .navbar-nav {
    display: flex;
    flex-direction: row;
  }
  
  .nav-item {
    margin: 0 0.375rem;
  }
  
  .nav-link {
    padding: 0.5rem 0.75rem;
  }
  
  /* Navigasi overlay - tidak diperlukan di desktop */
  .navbar-overlay {
    display: none !important;
  }
}

/* ===== ORIENTASI LANDSCAPE PADA SELULER ===== */
@media (max-width: 768px) and (orientation: landscape) {
  .auth-page {
    padding: 1rem;
  }
  
  .auth-right {
    padding: 1.5rem;
  }
  
  .auth-form-title {
    margin-bottom: 1rem;
  }
  
  .form-group {
    margin-bottom: 0.75rem;
  }
  
  /* Buat navbar-collapse tidak terlalu tinggi di landscape */
  .navbar-collapse {
    overflow-y: auto;
  }
}

/* ===== HIGH DPI SCREENS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimasi untuk layar retina */
  .auth-logo img,
  .navbar-brand img {
    transform: scale(1.1);
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  /* Navbar in dark mode */
  .navbar-collapse {
    background-color: #1F2937;
  }
  
  /* Auth pages in dark mode */
  .auth-right {
    background-color: #1F2937;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  body {
    background-color: #fff;
    color: #000;
    font-size: 12pt;
  }
  
  .navbar,
  .sidebar,
  .footer,
  .action-button,
  .search-form {
    display: none !important;
  }
  
  .container {
    max-width: 100%;
    width: 100%;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 90%;
  }
  
  abbr[title]:after {
    content: " (" attr(title) ")";
  }
}