/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background-color: #f5f5f5;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

/* Container Layout */
.container, .folderContentsDiv, .upload-container, .login-container {
  max-width: 960px;
  margin: auto;
  background: #ffffff;
  padding: 25px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Headings */
h1, h2, h3 {
  color: #212121;
  margin-bottom: 20px;
  text-align: center;
}

/* Buttons */
button, .btn, a.button-link {
  display: inline-block;
  background-color: #9E86F4;
  color: white;
  padding: 10px 18px;
  margin: 8px 0;
  border: none;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 16px;
}

button:hover, .btn:hover, a.button-link:hover {
  background-color: #9E86F4;
}

/* Logout Button */
.logout-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: #9E86F4;
}

.logout-btn:hover {
  background-color: #9E86F4;
}

/* Inputs */
input[type="text"],
input[type="password"],
input[type="file"],
select {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* File Table */
.file-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.file-table th, .file-table td {
  padding: 14px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
}

.file-table th {
  background-color: #9E86F4;
  color: white;
}

.file-table tr:hover {
  background-color: #f1f1f1;
}

/* Search */
.search-container {
  margin: 20px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#searchInput {
  flex: 1;
}

/* Spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #9E86F4;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Modal */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 10px;
}

.btn-cancel {
  background-color: #e0e0e0;
  color: #333;
}

.btn-confirm {
  background-color: #9E86F4;
  color: white;
}

.copy-btn {
  background-color: #009688;
}

.copy-btn:hover {
  background-color: #00796b;
}

/* Share Link */
.share-link-container {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.share-link {
  flex: 1;
}

/* Upload Controls Layout */
.upload-container, .upload-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
}

.upload-section {
  flex: 1 1 280px;
  background: #f8f9fa;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
  .search-container {
    flex-direction: column;
  }

  .upload-controls, .upload-container {
    flex-direction: column;
  }

  button, .btn, a.button-link {
    width: 100%;
    text-align: center;
  }
}

/* Miscellaneous */
.error {
  color: red;
  margin-top: 10px;
  text-align: center;
}

.empty {
  text-align: center;
  color: #888;
}


.file-image {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 20px auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.download-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #9E86F4;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 20px;
}

.back-btn {
    display: inline-block;
    margin-top: 30px;
    color: #9E86F4;
    text-decoration: none;
}

#fileMetadata {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
}

#fileMetadata p {
    margin: 5px 0;
}

/* Improved loader styles */
.loader {
    text-align: center;
    padding: 40px;
    color: #555;
    font-size: 16px;
}

/* Better PDF container */
.pdf-container {
    position: relative;
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
}

/* Enhanced error states */
.preview-error {
    padding: 20px;
    text-align: center;
    background: #ffebee;
    border-radius: 4px;
    margin: 10px 0;
}

/* Consistent action buttons */
.preview-actions {
    margin-top: 15px;
    text-align: center;
}

.preview-actions .btn {
    margin: 0 5px;
}

.file-preview {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.video-preview {
    width: 100%;
    max-height: 70vh;
    background: #000;
}

/*  */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
      transition: opacity 0.3s ease;

}

.modal.fade-out {
    opacity: 0;
}

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  text-align: center;
}

.modal-actions {
  margin-top: 20px;
}

.close-modal {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.share-link {
  word-break: break-all;
  margin: 15px 0;
  padding: 10px;
  background-color: #f5f5f5;
  border-radius: 4px;
}



.share-link-container {
    display: flex;
    margin: 15px 0;
}

.share-link {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-family: monospace;
}

.copy-btn {
    padding: 8px 12px;
    background: #9E86F4;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.3s;
}

.copy-btn:hover {
    background: #2980b9;
}

.copy-icon {
    margin-right: 5px;
    font-size: 16px;
}

/* Modal Share */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.share-options {
    margin: 20px 0;
}

.share-option {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.share-option h4 {
    margin-top: 0;
    color: #333;
}

.share-link-container {
    display: flex;
    margin-top: 10px;
}

.share-link {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.copy-btn, .generate-btn {
    padding: 8px 12px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 14px;
}

.generate-btn {
    border-radius: 4px;
    margin-top: 10px;
    width: 100%;
}

.copy-btn:hover, .generate-btn:hover {
    background-color: #3367d6;
}

.input-group {
    display: flex;
    align-items: center;
}

.input-group .prefix {
    padding: 8px;
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.input-group .share-link {
    border-radius: 0 4px 4px 0;
}

.hidden {
    display: none;
}

.notice {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.modal-actions {
    text-align: right;
    margin-top: 20px;
}

.close-modal {
    padding: 8px 16px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.close-modal:hover {
    background-color: #ddd;
}

.modal .link-options {
    margin: 20px 0;
}

.modal .option {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.modal .option input[type="radio"] {
    margin-right: 10px;
}

.modal .option label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.modal .option small {
    color: #666;
    margin-top: 5px;
}

#customLinkInput {
    margin-top: 5px;
    padding: 5px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.modal-content {
    position: relative;
}

.close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal-btn:hover {
    color: #333;
}

/* Jika Anda ingin tombol Tutup di bagian bawah lebih menonjol */
.modal-actions .close-modal {
    background-color: #f0f0f0;
    color: #333;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.modal-actions .close-modal:hover {
    background-color: #e0e0e0;
}

/* Tambahkan gaya tambahan di sini */

.login-container {
            background: white;
            padding: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
            width: 350px;
            text-align: center;
        }
        .login-container h1 {
            margin-bottom: 20px;
            color: #333;
        }
        .input-group {
            margin-bottom: 15px;
            text-align: left;
        }
        .input-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
        }
        .input-group input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        .login-btn {
            width: 100%;
            padding: 10px;
            background-color: #9E86F4;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }
        .login-btn:hover {
            background-color: #357ae8;
        }
        .error {
            color: red;
            margin-top: 10px;
        }

        .thumbnailfolder {
          width: 90px;
          height: 90px;
          justify-items: center;
          align-items: center;
          display: flex;
          margin-left: 40px;
        }

        /* Font Awesome */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* Ikon Folder */
.folder-icon {
  color: #9E86F4;
  font-size: 80px;
  text-align: center;
  margin-left: 20px;
}

/* Container Ikon File */
.file-icon-container {
  position: relative;
  width: 80px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Ikon File */
.file-icon {
  font-size: 65px;
  margin-bottom: 8px;
  color: #9E86F4;
    margin-left: 40px;

}

/* Ekstensi File */
.file-ext {
  font-size: 12px;
  color: #9E86F4;
  text-transform: uppercase;
  background: #f1f3f4;
  padding: 2px 6px;
  border-radius: 3px;
    margin-left: 34px;

}

/* Warna khusus berdasarkan tipe file */
.file-icon-container[data-ext="pdf"] .file-icon { color: #f44336; }
.file-icon-container[data-ext^="doc"] .file-icon { color: #2196f3; }
.file-icon-container[data-ext^="xls"] .file-icon { color: #4caf50; }
.file-icon-container[data-ext^="ppt"] .file-icon { color: #ff9800; }
.file-icon-container[data-ext="zip"] .file-icon { color: #9E86F4; }
.file-icon-container[data-ext="rar"] .file-icon { color: #795548; }
.file-icon-container[data-ext="js"] .file-icon { color: #ffd600; }
.file-icon-container[data-ext="html"] .file-icon { color: #e65100; }
.file-icon-container[data-ext="css"] .file-icon { color: #2962ff; }

/* Thumbnail untuk gambar */
.thumbnail {
width: 150px;
}


/* Membuat tabel responsif */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive .file-table {
  min-width: 600px; /* Atau lebih kecil tergantung jumlah kolom */
}

@media (max-width: 768px) {
  .file-table, .file-table thead, .file-table tbody, .file-table th, .file-table td, .file-table tr {
    display: block;
    
  }

  .table-responsive {
    overflow-x: auto;
    position: relative;
    white-space: nowrap;
    align-items: center;
    justify-content: center;
  }

  .file-table tbody {
    width: 40%;
    margin-left: 20px;
  }

  .file-table thead {
    display: none; /* Sembunyikan header di mobile */
  }

  .file-table tr {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
  }

  .file-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: none;
    position: relative;
  }

  .file-table td::before {
    content: attr(data-label);
    font-weight: bold;
    display: block;
    color: #555;
    margin-bottom: 4px;
  }

  .file-table td:last-child {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
}



/*  */

@media (max-width: 768px) {
  .file-table td {
    font-size: 10px;
    padding: 6px 10px;
  }

  .file-table td::before {
    font-size: 12px;
    margin-bottom: 2px;
    color: #777;
  }

  .file-table td:last-child button,
  .file-table td:last-child .btn,
  .file-table td:last-child a.button-link {
    font-size: 10px;
    padding: 5px 7px;
    width: 100%;
    white-space: normal;
    word-break: break-word;
  }

  .file-table tr {
    padding: 7px;
    border-radius: 6px;
  }

  .thumbnailfolder {
    width: 70px;
    height: 70px;
    margin: auto;
  }

  .file-icon {
    font-size: 48px;
  }

  .file-ext {
    font-size: 11px;
  }
}




/* Tombol-tombol aksi agar lebih responsif */
.aksi-col {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

@media (max-width: 768px) {
  .aksi-col {
    flex-direction: column;
    align-items: stretch;
  }

  .aksi-col button,
  .aksi-col .btn,
  .aksi-col a.button-link {
    width: 75% !important;
    font-size: 14px;
    padding: 10px;
    box-sizing: border-box;
  }
}



/* Enhanced Responsive Modal */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 15px;
  }
  
  /* Specific styles for the success modal */
  .success-modal .modal-content {
    max-width: 100%;
    margin: 20px auto;
    padding: 20px 15px;
  }
  
  .success-modal h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
  }
  
  .success-modal p {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-actions button {
    width: 100%;
    margin: 5px 0;
  }
  
  /* Adjust share link container for mobile */
  .share-link-container {
    flex-direction: column;
  }
  
  .share-link {
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 12px;
    padding: 10px;
    word-break: break-all;
  }
  
  .copy-btn {
    border-radius: 4px;
    width: 100%;
    justify-content: center;
  }
}

/* Success Modal Specific Styles */
.success-modal .modal-content {
  text-align: center;
}

.success-modal .icon-success {
  font-size: 50px;
  color: #4CAF50;
  margin-bottom: 20px;
}

/* Animation for modal appearance */
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-content {
  animation: modalFadeIn 0.3s ease-out;
}

@media (max-width: 768px) {
  .link-options .option {
    padding: 12px;
  }
  
  .url-small {
    font-size: 11px;
  }
}

/* Styling untuk folder pintasan */
/* .folder-shortcut {
    border-left: 4px solid #9E86F4;
    background-color: #f8f9ff !important;
} */

/* .folder-shortcut:hover {
    background-color: #f0f2ff !important;
} */

/* .shortcut-badge {
    background-color: #9E86F4;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: bold;
} */

/* Ikon khusus untuk folder pintasan */
.folder-shortcut .folder-icon {
    color: #9E86F4 !important;
}

/* Responsif untuk badge */
/* @media (max-width: 768px) {
    .shortcut-badge {
        display: block;
        margin: 5px 0 0 0;
        width: fit-content;
    }
    
    .folder-shortcut td::before {
        color: #9E86F4;
        font-weight: bold;
    }
} */

/* Highlight untuk row folder pintasan */


/* Styling untuk modal tambah folder pintasan */
.input-group {
  margin-bottom: 15px;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.input-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.input-group small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 12px;
  line-height: 1.4;
}

/* video */

/* Video Thumbnail Styles */
.thumbnail-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.thumbnail-container:hover {
  transform: scale(1.05);
}

.video-thumbnail:hover .video-play-overlay {
  background-color: rgba(158, 134, 244, 0.8);
}

.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.video-play-overlay i {
  color: white;
  font-size: 2rem;
  opacity: 0.9;
}

/* Video Modal Styles */
.video-modal-content {
  max-width: 90%;
  width: 800px;
  text-align: center;
}

.video-player-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  margin: 15px 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

.video-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.video-actions .download-btn {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s ease;
}

.video-actions .download-btn:hover {
  background-color: #45a049;
}

/* Responsive Video Modal */
@media (max-width: 768px) {
  .video-modal-content {
    width: 95%;
    margin: 5% auto;
  }
  
  .video-player-container {
    padding-bottom: 75%; /* 4:3 aspect ratio untuk mobile */
  }
  
  .video-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .video-actions .download-btn,
  .video-actions .btn-cancel {
    width: 100%;
    text-align: center;
  }
}

/* Thumbnail size consistency */
.thumbnail {
  width: 150px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.video-thumb {
  border: 2px solid #9E86F4;
}

/* Loading state untuk video */
.video-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  color: #666;
  font-style: italic;
}