/* Custom styling untuk Admin Panel */

:root {
  --primary-color: #00695c;
  --secondary-color: #004d40;
  --text-color: #333;
  --background-color: #f5f5f5;
  --card-background: #ffffff;
  --hover-color: rgba(0, 105, 92, 0.1);
  --transition-speed: 0.3s;
  --border-radius: 4px;
  --spacing-unit: 16px;
}

body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background-color: var(--background-color);
  color: var(--text-color);
}

main {
  flex: 1;
  padding: var(--spacing-unit) 0;
}

/* Material Design Elevation */
.z-depth-1 {
  box-shadow: var(--shadow-1) !important;
}

.z-depth-2 {
  box-shadow: var(--shadow-2) !important;
}

/* Card animations and styling */
.card {
  border-radius: var(--border-radius);
  transition: transform var(--transition-speed);
}

.card:hover {
  transform: translateY(-2px);
}

.card .card-content {
  padding: calc(var(--spacing-unit) * 1.5);
}

.card .card-action {
  border-top: 1px solid var(--divider-color);
  padding: 16px 24px;
}

/* Button styling */
.btn, .btn-large {
  background-color: var(--primary-color);
  transition: background-color var(--transition-speed);
}

.btn:hover, .btn-large:hover {
  background-color: var(--secondary-color);
}

.btn-small {
  height: 32px;
  line-height: 32px;
  padding: 0 1rem;
  margin: 2px;
  display: inline-block;
}

.btn-small i {
  font-size: 1.2rem;
  line-height: inherit;
}

.btn-small.red {
  background-color: #f44336;
}

.btn-small.red:hover {
  background-color: #e53935;
}

.btn-floating {
  box-shadow: var(--shadow-1);
  transition: var(--transition);
}

.btn-floating:hover {
  box-shadow: var(--shadow-2);
  transform: scale(1.1);
}

/* Table improvements */
table {
  border-collapse: separate;
  border-spacing: 0;
}

table.striped > tbody > tr:nth-child(odd) {
  background-color: rgba(38, 166, 154, 0.05);
}

table.highlight > tbody > tr {
  transition: var(--transition);
  cursor: default;
}

table.highlight > tbody > tr:hover {
  background-color: var(--hover-color);
}

/* Responsive tables */
.responsive-table {
  width: 100%;
  margin-bottom: 1rem;
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.responsive-table th {
  background-color: var(--primary-color);
  color: white;
  padding: 15px;
}

.responsive-table td {
  padding: 12px 15px;
}

/* Sidebar styling */
.collection {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.collection .collection-item {
  border-bottom: 1px solid rgba(0,0,0,0.1);
  transition: background-color var(--transition-speed);
}

.collection .collection-item:hover {
  background-color: var(--hover-color);
}

.collection .collection-item.active {
  background-color: var(--primary-color);
}

.collection .collection-header {
  background-color: #26a69a;
  color: #323232;
  padding: 15px;
}

/* Cards stats styling */
.card-stats {
  position: relative;
  min-height: 120px;
}

.stats-icon {
  position: absolute;
  right: var(--spacing-unit);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.2;
  font-size: 5rem !important;
}

/* Footer styling */
.page-footer {
  background-color: var(--primary-color);
  padding-top: 10px;
  padding-bottom: 10px;
  margin-top: 20px;
}

/* Desktop optimizations */
@media only screen and (min-width: 993px) {
  .container {
    width: 95%;
    max-width: none;
  }
  
  /* Main container */
  .main-container {
    padding-left: 0;
    padding-right: 0;
  }
  
  /* Full width navbar */
  nav .nav-wrapper {
    width: 95%;
    margin: 0 auto;
  }
  
  /* Full width table */
  table {
    width: 100%;
    table-layout: fixed;
  }
  
  /* Remove sidebar padding */
  .collection {
    padding: 0;
    margin: 0;
    border: none;
  }
  
  .collection .collection-item {
    padding: 10px 15px;
    border-radius: 0;
  }
  
  .collection .collection-header {
    padding: 10px 15px;
    border-radius: 0;
  }
  
  /* Full width cards */
  .card {
    width: 100%;
    margin: 0 0 20px 0;
  }
  
  /* Adjust column widths for better table display */
  .card-content {
    padding: 20px;
    width: 100%;
    overflow-x: auto;
  }
  
  /* Adjust sidebar width */
  .row .col.l3 {
    width: 20%;
    padding: 0;
  }
  
  .row .col.l9 {
    width: 80%;
    padding-right: 0;
  }
  
  /* Optimize table cell widths */
  table.responsive-table th, 
  table.responsive-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Action column width */
  table.responsive-table th:last-child, 
  table.responsive-table td:last-child {
    width: 120px;
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
  }
  
  /* Footer always at bottom */
  body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
  }
  
  main {
    flex: 1 0 auto;
  }
  
  .page-footer {
    margin-top: 0;
    position: sticky;
    bottom: 0;
    width: 100%;
    z-index: 900;
  }
}

/* Mobile optimizations */
@media only screen and (max-width: 600px) {
  .container {
    width: 100%;
    padding: 0 10px;
  }
  
  h4 {
    font-size: 1.8rem;
  }
  
  .card-stats h4 {
    font-size: 1.5rem;
  }
  
  /* Modal responsif untuk mobile */
  .modal {
    width: 95%;
    height: auto;
    max-height: 85%;
  }
  
  .modal .modal-content {
    padding: 15px;
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .modal .modal-footer {
    position: sticky;
    bottom: 0;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    background-color: #f9f9f9;
    z-index: 10;
  }
  
  .modal-footer .btn, 
  .modal-footer .btn-flat {
    margin: 5px;
    height: auto;
    line-height: 36px;
    padding: 0 1rem;
    display: inline-block;
    width: auto;
  }
  
  /* Memastikan form input responsif */
  .input-field {
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  
  .input-field input, 
  .input-field select,
  .input-field textarea {
    font-size: 16px; /* Mencegah zoom otomatis pada iOS */
  }
  
  /* Memperbaiki ukuran tombol pada mobile */
  .btn, .btn-flat {
    height: auto;
    line-height: 36px;
    font-size: 0.9rem;
  }
  
  /* Perbaikan untuk header dan tombol pada bagian manajemen user/akun */
  .row .col.s6 {
    width: 100%;
    margin-bottom: 10px;
  }

  /* Perbaikan untuk tombol-tombol di samping judul */
  .row .col.s6.right-align {
    text-align: left;
    margin-top: 10px;
  }

  /* Membuat tombol-tombol responsif pada tampilan mobile */
  .right-align button {
    display: inline-block;
    margin-bottom: 5px;
    margin-right: 5px;
  }
  
  /* Perbaikan untuk tabel responsif */
  table.responsive-table {
    width: 100%;
    display: block;
    overflow-x: auto;
  }
  
  /* Menyesuaikan ukuran tombol di dalam tabel */
  table .btn-small {
    font-size: 0.8rem;
    padding: 0 0.5rem;
  }
  
  /* Perbaikan untuk card action buttons */
  .card-action {
    text-align: center;
  }
  
  /* Memastikan konten tidak terpotong di bawah modal */
  .modal-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Preloader styling */
#preloader {
  background: rgba(255, 255, 255, 0.9);
  z-index: 10000; /* Ensure it's above everything */
  pointer-events: none; /* Make sure it doesn't block clicks when visible */
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Modal styling */
.modal {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  max-height: 90%;
  width: 90%; /* Memperkecil modal untuk tampilan mobile */
  max-width: 800px; /* Maksimum lebar pada desktop */
}

.modal .modal-content {
  padding: calc(var(--spacing-unit) * 1.5);
}

.modal .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  background-color: #f9f9f9;
  border-top: 1px solid var(--divider-color);
  padding: 12px 24px;
}

.modal .modal-footer button {
  margin: 0 5px;
  min-width: 80px;
}

.modal h4 {
  margin-top: 0;
  font-weight: 400;
  color: var(--primary-color);
}

/* Modal animations */
.modal {
  transform: scale(0.8);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal.open {
  transform: scale(1);
  opacity: 1;
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.5);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Input focus color */
input:focus {
  border-bottom: 1px solid var(--primary-color) !important;
  box-shadow: 0 1px 0 0 var(--primary-color) !important;
}

input:focus + label {
  color: var(--primary-color) !important;
}

/* Toast message styling */
.toast {
  background-color: #323232;
  border-radius: 24px;
  box-shadow: var(--shadow-1);
}

/* Dashboard cards */
.dashboard-card {
  min-height: 120px;
}

/* Status badges */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.status-connected {
  background-color: #4CAF50;
  color: white;
}

.status-disconnected {
  background-color: #f44336;
  color: white;
}

/* Form improvements */
.input-field {
  margin-top: 1.5rem;
}

.input-field label {
  color: var(--text-secondary);
}

.input-field input[type=text],
.input-field input[type=email],
.input-field input[type=password],
.input-field textarea.materialize-textarea {
  border-bottom: 1px solid var(--divider-color);
}

/* Button spacing */
.btn {
  margin-right: 5px;
}

/* Animation for page transitions */
.page-content {
  animation: fadeIn var(--transition-speed);
}

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

/* Ripple effect */
.waves-effect.waves-custom .waves-ripple {
  background-color: rgba(38, 166, 154, 0.4);
}

/* Navbar styling */
nav {
  background-color: var(--primary-color);
  margin-bottom: var(--spacing-unit);
  padding: 0 var(--spacing-unit);
}

nav .brand-logo {
  padding-left: var(--spacing-unit);
}

/* Table header styling */
table thead th {
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 10px;
  padding-top: 10px;
}

/* Improved scrollbars */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* Input field animations */
.input-field input[type=text]:focus,
.input-field input[type=email]:focus,
.input-field input[type=password]:focus,
.input-field textarea.materialize-textarea:focus {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateY(-2px);
}

/* Card hover effects */
.card {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform: translateZ(0);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

/* Collection item hover effects */
.collection a.collection-item {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  z-index: 1;
}

.collection a.collection-item:hover {
  padding-left: 20px;
}

.collection a.collection-item.active:hover {
  background-color: var(--primary-dark);
}

/* Preloader animation */
@keyframes fadeInOut {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

#preloader .preloader-wrapper {
  animation: fadeInOut 1.5s infinite ease-in-out;
}

/* Main Container */
.main-container {
  margin-top: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
}

/* Modal Buttons */
.modal-footer .btn {
  margin: 6px;
}

/* Responsive Adjustments */
@media only screen and (max-width: 992px) {
  nav .brand-logo {
    padding-left: 0;
  }
  
  .container {
    width: 95%;
  }
}

/* Input Fields */
input:not([type]):focus:not([readonly]),
input[type=text]:focus:not([readonly]),
input[type=password]:focus:not([readonly]),
input[type=email]:focus:not([readonly]),
input[type=url]:focus:not([readonly]),
input[type=time]:focus:not([readonly]),
input[type=date]:focus:not([readonly]),
input[type=datetime]:focus:not([readonly]),
input[type=datetime-local]:focus:not([readonly]),
input[type=tel]:focus:not([readonly]),
input[type=number]:focus:not([readonly]),
input[type=search]:focus:not([readonly]),
textarea.materialize-textarea:focus:not([readonly]) {
  border-bottom: 1px solid var(--primary-color);
  box-shadow: 0 1px 0 0 var(--primary-color);
}

/* Label active state */
.input-field > label.active {
  color: var(--primary-color);
  transform: translateY(-14px) scale(0.8);
}

/* Input with value */
input.valid:not([type]),
input.valid[type=text],
input.valid[type=password],
input.valid[type=email],
input.valid[type=url],
input.valid[type=time],
input.valid[type=date],
input.valid[type=datetime],
input.valid[type=datetime-local],
input.valid[type=tel],
input.valid[type=number],
input.valid[type=search],
textarea.valid.materialize-textarea {
  border-bottom: 1px solid var(--primary-color);
  box-shadow: 0 1px 0 0 var(--primary-color);
}

/* Animations */
.waves-custom:hover {
  background-color: var(--hover-color) !important;
}

/* Table Styles */
.responsive-table {
  width: 100%;
  margin-bottom: 1rem;
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.responsive-table th {
  background-color: var(--primary-color);
  color: white;
  padding: 15px;
}

.responsive-table td {
  padding: 12px 15px;
}

/* Card Content Spacing */
.card-content p {
  margin: 8px 0;
}

/* Main Container */
.main-container {
  margin-top: var(--spacing-unit);
  margin-bottom: var(--spacing-unit);
}

/* Modal Buttons */
.modal-footer .btn {
  margin: 6px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.action-buttons .btn-small {
  margin: 0 3px;
  min-width: 36px;
}

/* Row tanpa margin bawah */
.row.mb-0 {
  margin-bottom: 0;
}

/* Warna baris tabel berdasarkan tanggal expired */
tr.expired-warning {
  background-color: rgba(255, 235, 59, 0.2) !important;
}

tr.expired-danger {
  background-color: rgba(244, 67, 54, 0.2) !important;
}

/* Override untuk striped table */
table.striped > tbody > tr.expired-warning:nth-child(odd),
table.striped > tbody > tr.expired-warning:nth-child(even) {
  background-color: rgba(255, 235, 59, 0.2) !important;
}

table.striped > tbody > tr.expired-danger:nth-child(odd),
table.striped > tbody > tr.expired-danger:nth-child(even) {
  background-color: rgba(244, 67, 54, 0.2) !important;
}

/* Section dan divider dalam card */
.card .divider {
  margin: 15px 0;
  background-color: rgba(0, 0, 0, 0.1);
}

.card .section {
  padding-top: 10px;
}

.card h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--primary-color);
  font-weight: 400;
  font-size: 2rem;
}

/* Input pencarian */
.input-field.right-align {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.input-field.right-align .prefix {
  position: relative;
  top: 0;
  margin-right: 10px;
}

.input-field.right-align input {
  margin-bottom: 0;
  width: 200px;
  height: 2rem;
  border-bottom: 1px solid #9e9e9e;
  transition: all 0.3s;
}

.input-field.right-align input:focus {
  width: 250px;
  border-bottom: 1px solid var(--primary-color);
  box-shadow: 0 1px 0 0 var(--primary-color);
}

/* Perbaikan untuk modal di mobile */
.modal .modal-content {
  padding-bottom: 80px;
}

/* Tambah spasi sebelum footer untuk mencegah konten terakhir tertutup tombol */
form {
  margin-bottom: 20px;
} 