/* ====================== General Styles ====================== */
body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  background-color: #cacdd8;
  color: #000;
  transition: background 0.3s, color 0.3s;
}

body.dark {
  background-color: #4e4b4b;
  color: #e0e0e0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

input, select {
  margin: 6px 4px;
  padding: 8px 12px;
  font-size: 1em;
  border: 1px solid #aaa;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}

input:focus, select:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 4px rgba(0,123,255,0.15);
}

label {
  font-weight: 500;
  margin-right: 8px;
  display: inline-block;
  min-width: 100px;
}

/* ====================== Login Section ====================== */
#login-section{
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, #ffffff, #f7f7f9);
}

body.dark #login-section{
  background: linear-gradient(180deg, #0e0e0e, #121212);
}

.login-card{
  width: 100%;
  max-width: 420px;
  padding: 28px 26px 24px;
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(182, 196, 202, 0.85);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.5) inset;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .15s ease, box-shadow .2s ease;
}

body.dark .login-card{
  background: rgba(65, 63, 63, 0.8);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 10px 25px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.03) inset;
}

.login-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.12), 0 1px 0 rgba(255,255,255,0.6) inset;
}

.login-card h2{
  margin: 0 0 14px 0;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Login Form */
#login-form{
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.field{
  display: grid;
  gap: 6px;
}

.field label{
  font-weight: 600;
  font-size: .92rem;
  color: #333;
}
body.dark .field label{ color: #d7d7d7; }

#login-form input[type="text"],
#login-form input[type="password"]{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cdd6e1;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s;
}
body.dark #login-form input[type="text"],
body.dark #login-form input[type="password"]{
  background: #414040;
  border-color: #2a2a2a;
  color: #e8e8e8;
}

/* Password toggle button */
.input-affix{
  position: relative;
}
.input-affix input{
  padding-right: 40px;
}
.input-affix .toggle-visibility{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  opacity: .75;
}
.input-affix .toggle-visibility:hover{ opacity: 1; }

/* Submit button */
#login-form button[type="submit"]{
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  background: linear-gradient(180deg, #007bff, #0066d6);
  color: #fff;
  box-shadow: 0 6px 14px rgba(0,123,255,0.25);
}
#login-form button[type="submit"]:hover{
  filter: brightness(1.03);
  transform: translateY(-1px);
}
#login-form button[type="submit"]:active{
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(0,123,255,0.2);
}

/* Helper row */
.helper-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .92rem;
  gap: 8px;
}
.helper-row a{
  color: #1a73e8;
  text-decoration: none;
}
.helper-row a:hover{ text-decoration: underline; }

/* Error state */
.form-error{
  background: #ffeef0;
  color: #c62828;
  border: 1px solid #f2b8b5;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: .92rem;
}
body.dark .form-error{
  background: rgba(198,40,40,0.15);
  border-color: rgba(198,40,40,0.35);
  color: #ffb4b4;
}

/* Small note */
.subtle{
  font-size: .85rem;
  opacity: .8;
}

/* ====================== File Browser ====================== */
#browser-section {
  display: none;
  padding: 20px;
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

#current-path {
  font-weight: bold;
  font-size: 1.1em;
}

/* Buttons general styling */
button {
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background-color: #007bff;
  color: white;
  font-weight: 500;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.15s;
}

button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

body.dark button {
  background-color: #1a73e8;
}

body.dark button:hover {
  background-color: #0056b3;
}

/* Admin action buttons */
.admin-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 15px;
}

/* Upload & Folder buttons */
#upload-section button,
#folder-section button {
  margin-left: 6px;
  font-size: 0.9rem;
}

/* Table Card Style */
.table-card {
  background: #f9f9f9;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  margin-bottom: 20px;
  overflow-x: auto;
}

body.dark .table-card {
  background: #3d3b3b;
  box-shadow: 0 4px 12px rgba(255,255,255,0.05);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

th {
  background: #007bff;
  color: white;
  padding: 12px 16px;
  text-align: left;
  border-radius: 8px 8px 0 0;
}
body.dark th { background: #1a73e8; }

tbody tr {
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

tbody tr:nth-child(odd) { background: #ffffff; }
tbody tr:nth-child(even) { background: #f0f0f0; }
body.dark tbody tr:nth-child(odd) { background: #161616; }
body.dark tbody tr:nth-child(even) { background: #1d1d1d; }

tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
body.dark tbody tr:hover {
  box-shadow: 0 4px 12px rgba(255,255,255,0.08);
}

th, td {
  padding: 12px 16px;
  text-align: left;
}

/* File Table Action Buttons */
#file-table button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #007bff;
  background-color: #007bff;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.2s;
  margin-right: 4px;
}

#file-table button:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

body.dark #file-table button {
  border-color: #1a73e8;
  background-color: #1a73e8;
  color: #fff;
}

body.dark #file-table button:hover {
  background-color: #0056b3;
}

/* ====================== Modals ====================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(56, 55, 55, 0.6);
}
.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
}
.modal .close {
  position: absolute;
  top: 5px;
  right: 15px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

/* ====================== Upload / Progress ====================== */
progress {
  width: 100%;
  height: 20px;
  margin-top: 10px;
  border-radius: 6px;
  overflow: hidden;
}

/* ====================== Global Loader ====================== */
#global-loader {
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(255,255,255,0.6);
  display: none;
  align-items: center;
  justify-content: center;
}
body.dark #global-loader {
  background: rgba(51, 49, 49, 0.5);
}
.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #ccc;
  border-top-color: #007bff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====================== Responsive ====================== */
@media (max-width: 520px){
  .login-card{
    padding: 22px 18px 18px;
    border-radius: 14px;
  }
  .login-card h2{ font-size: 1.25rem; }
}

