/* ========================================================== 
   HomeCloud Global Glass UI System (Finalized Edition)
   Theme: Blue–White–Brown Gradient | iOS Glass Aesthetic
   ========================================================== */

/* ========== RESET & ROOT ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core Theme Colors */
  --blue: #1e90ff;
  --blue-dark: #4169e1;
  --brown-dark: #2d2416;
  --black: #0b0b0b;
  --white: #ffffff;
  --glass-bg: rgba(0, 0, 0, 0.8);
  --border-light: rgba(255, 255, 255, 0.12);
  --text: #e6e6e6;
  --radius: 14px;
}

/* ========== BODY ========== */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1a1a1a 0%, var(--brown-dark) 50%, #1a1a1a 100%);
  position: relative;
  color: var(--text);
  overflow-x: hidden;
}

/* ✅ FIXED: Watermark Background */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: url("../public/Anotida_developer_logo.png") no-repeat center center;
  background-size: 500px auto; /* Adjust for desired size */
  opacity: 0.08; /* Gentle opacity */
  z-index: 0;
  pointer-events: none;
  filter: blur(2px) brightness(1.1);
}

/* 🔷 Radial Accent Lighting */
body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(30,144,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(30,144,255,0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ========== UNIVERSAL CONTAINER ========== */
.container-glass {
  background: var(--glass-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4),
              inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

/* ==========================================================
   LOGIN PANEL
   ========================================================== */
.login-container {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(160%);
  padding: 50px 45px;
  width: 100%;
  max-width: 420px;
  z-index: 1;
  animation: slideUp 0.6s ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   HEADINGS & FORMS
   ========================================================== */
h1, h2, h3 {
  color: var(--white);
  font-weight: 600;
  letter-spacing: 0.4px;
  text-shadow: 0 2px 8px rgba(30, 144, 255, 0.25);
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

label {
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 500;
}

input, select {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(30, 144, 255, 0.25);
  border-radius: 10px;
  color: var(--white);
  font-size: 15px;
  transition: all 0.3s ease;
}

input:focus, select:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(30, 144, 255, 0.15),
              0 5px 15px rgba(30, 144, 255, 0.25);
}

select option {
  background-color: #111;
  color: #ffffff;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
button, input[type="submit"] {
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: var(--white);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(30, 144, 255, 0.25);
  transition: all 0.3s ease;
}

button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

button:hover::before { left: 100%; }
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(30, 144, 255, 0.4);
}
button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(30, 144, 255, 0.25);
}

/* ==========================================================
   DASHBOARD & TABLES
   ========================================================== */
.dashboard-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  width: 240px;
  padding: 30px 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 2;
}

.sidebar h2 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--blue);
}

.sidebar a {
  display: block;
  color: var(--white);
  text-decoration: none;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 8px;
  transition: 0.3s;
}
.sidebar a:hover {
  background: rgba(30, 144, 255, 0.15);
}

.content-area {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: relative;
  z-index: 2;
}

/* Tables */
.table-glass {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.table-glass th, .table-glass td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table-glass th {
  background: rgba(30, 144, 255, 0.1);
  color: var(--white);
}

.table-glass tr:hover {
  background: rgba(30, 144, 255, 0.07);
}

/* ==========================================================
   MODALS
   ========================================================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 9999;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal.hide {
  animation: fadeOut 0.3s ease forwards;
}

.modal-content {
  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid rgba(30, 144, 255, 0.25);
  border-radius: 14px;
  padding: 30px 40px;
  text-align: center;
  width: 90%;
  max-width: 420px;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5),
              inset 0 1px 1px rgba(255,255,255,0.05);
  animation: fadeSlide 0.4s ease;
  position: relative;
  z-index: 10000;
}

.modal-close {
  position: absolute;
  right: 18px;
  top: 10px;
  font-size: 24px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: color 0.3s;
}
.modal-close:hover { color: var(--blue); }

@keyframes fadeSlide {
  from { transform: translateY(25px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.9); opacity: 0; }
}

/* ==========================================================
   ALERTS
   ========================================================== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  margin-bottom: 15px;
}

.alert-success { background: rgba(0,255,150,0.1); border: 1px solid rgba(0,255,150,0.3); color: #7CFFB2; }
.alert-warning { background: rgba(255,200,0,0.1); border: 1px solid rgba(255,200,0,0.3); color: #FFD66E; }
.alert-error { background: rgba(255,0,0,0.1); border: 1px solid rgba(255,0,0,0.3); color: #FF6B6B; }

/* ==========================================================
   LIVE TABLE REFRESH ANIMATION
   ========================================================== */
@keyframes rowGlow {
  0%   { background-color: rgba(30,144,255,0.35); }
  50%  { background-color: rgba(30,144,255,0.15); }
  100% { background-color: transparent; }
}

.highlight-row {
  animation: rowGlow 1.5s ease-out;
}

/* ==========================================================
   LIVE ACTIVITY LOG PANEL
   ========================================================== */
.log-panel {
  padding: 20px;
  width: 350px;
  max-height: 80vh;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  position: absolute;
  top: 40px;
  right: 40px;
  border-radius: 14px;
}

.log-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-entry {
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  color: #fff;
  opacity: 0.9;
}

.log-action {
  font-size: 15px;
  font-weight: 600;
  color: var(--blue);
}

.log-details {
  font-size: 14px;
  opacity: 0.8;
}

.log-meta {
  margin-top: 5px;
  font-size: 12px;
  opacity: 0.7;
}

/* Slide animation */
@keyframes slideIn {
  from { opacity: 0; transform: translateX(25px); }
  to   { opacity: 1; transform: translateX(0); }
}
.slide-in {
  animation: slideIn 0.6s ease-out;
}

/* ==========================================================
   STORAGE OVERVIEW – GLASS PROGRESS BARS
   ========================================================== */
.storage-row {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 22px;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  box-shadow: 0 6px 22px rgba(0,0,0,0.35);
  animation: fadeSlide 0.4s ease-out;
}

.storage-row strong {
  font-size: 16px;
  color: var(--white);
}

.storage-bar {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.09);
  border-radius: 10px;
  margin: 10px 0 6px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}

.storage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-dark));
  border-radius: 10px;
  transition: width 0.6s ease;
  box-shadow: 0 0 10px rgba(30,144,255,0.5);
}

.storage-meta,
.muted {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

.file-panel {
  max-width: 1000px;
  margin: 0 auto;
  padding: 25px;
}

/* ==========================================================
   HAMBURGER MENU FOR MOBILE
   ========================================================== */

/* Hamburger Button - Hidden on Desktop */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  background: rgba(30, 144, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(30, 144, 255, 0.3);
  transition: all 0.3s ease;
}

.hamburger-btn:hover {
  background: rgba(30, 144, 255, 1);
  transform: scale(1.05);
}

.hamburger-btn:active {
  transform: scale(0.95);
}

/* Hamburger Icon */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24px;
}

.hamburger-icon span {
  display: block;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Animated Hamburger to X */
.hamburger-btn.active .hamburger-icon span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-btn.active .hamburger-icon span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.hamburger-btn.active .hamburger-icon span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Overlay for when menu is open */
.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* ==========================================================
   RESPONSIVE DESIGN - TABLETS & PHONES
   ========================================================== */

/* ========== TABLET (768px - 1024px) ========== */
@media (max-width: 1024px) {
  /* Body adjustments */
  body::after {
    background-size: 400px auto;
  }

  /* Login container */
  .login-container {
    max-width: 380px;
    padding: 40px 35px;
  }

  /* Show hamburger on tablets */
  .hamburger-btn {
    display: block;
  }

  /* Dashboard layout */
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    width: 260px;
    z-index: 9998;
    transition: left 0.3s ease;
    overflow-y: auto;
    flex-direction: column;
    flex-wrap: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar h2 {
    font-size: 16px;
    width: 100%;
    text-align: left;
    margin-bottom: 15px;
  }

  .sidebar a {
    width: 100%;
    margin: 5px 0;
    text-align: left;
  }

  .content-area {
    padding: 30px;
    gap: 25px;
    margin-left: 0;
    width: 100%;
  }

  /* Log panel */
  .log-panel {
    width: 300px;
    top: 30px;
    right: 30px;
  }

  /* Tables */
  .table-glass th, .table-glass td {
    padding: 12px;
    font-size: 14px;
  }

  /* File panel */
  .file-panel {
    max-width: 900px;
    padding: 20px;
  }
}

/* ========== SMALL TABLET / LARGE PHONE (600px - 768px) ========== */
@media (max-width: 768px) {
  /* Body adjustments */
  body {
    align-items: flex-start;
    padding: 20px 0;
  }

  body::after {
    background-size: 300px auto;
    opacity: 0.05;
  }

  /* Login container */
  .login-container {
    max-width: 90%;
    padding: 35px 25px;
    margin: 20px auto;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 18px;
  }

  /* Forms */
  input, select {
    padding: 12px 16px;
    font-size: 14px;
  }

  button, input[type="submit"] {
    padding: 12px;
    font-size: 15px;
  }

  /* Hamburger menu */
  .hamburger-btn {
    display: block;
    top: 15px;
    left: 15px;
  }

  /* Dashboard - with hamburger */
  .dashboard-container {
    flex-direction: row;
  }

  .sidebar {
    left: -280px;
    width: 280px;
    padding: 80px 20px 20px 20px;
    flex-direction: column;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar h2 {
    width: 100%;
    text-align: left;
    margin-bottom: 15px;
  }

  .sidebar a {
    width: 100%;
    margin: 5px 0;
    padding: 8px 12px;
    font-size: 14px;
    text-align: left;
  }

  .content-area {
    width: 100%;
    margin-left: 0;
    padding: 70px 20px 20px 20px;
    gap: 20px;
  }

  /* Log panel - moves to bottom on tablet */
  .log-panel {
    position: relative;
    width: 100%;
    max-width: 100%;
    right: 0;
    top: 0;
    margin-top: 20px;
    max-height: 400px;
  }

  /* Tables - horizontal scroll */
  .table-glass {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .table-glass th, .table-glass td {
    padding: 10px;
    font-size: 13px;
  }

  /* Modal */
  .modal-content {
    padding: 25px 30px;
    max-width: 90%;
  }

  /* Storage row */
  .storage-row {
    padding: 15px 18px;
    margin-bottom: 18px;
  }

  .storage-row strong {
    font-size: 15px;
  }

  /* File panel */
  .file-panel {
    max-width: 100%;
    padding: 20px 15px;
  }
}

/* ========== MOBILE PHONES (up to 600px) ========== */
@media (max-width: 600px) {
  /* Body adjustments */
  body {
    padding: 15px 0;
  }

  body::after {
    background-size: 250px auto;
    opacity: 0.04;
  }

  /* Login container */
  .login-container {
    max-width: 95%;
    padding: 30px 20px;
    margin: 15px auto;
    border-radius: 12px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 18px;
  }

  h3 {
    font-size: 16px;
  }

  /* Forms */
  form {
    gap: 15px;
  }

  label {
    font-size: 13px;
  }

  input, select {
    padding: 11px 14px;
    font-size: 14px;
    border-radius: 8px;
  }

  button, input[type="submit"] {
    padding: 11px;
    font-size: 14px;
    border-radius: 8px;
  }

  /* Hamburger menu */
  .hamburger-btn {
    top: 12px;
    left: 12px;
    padding: 8px 10px;
  }

  .hamburger-icon {
    width: 22px;
  }

  /* Dashboard */
  .sidebar {
    width: 260px;
    left: -280px;
    padding: 70px 15px 15px 15px;
    flex-direction: column;
  }

  .sidebar.active {
    left: 0;
  }

  .sidebar h2 {
    font-size: 16px;
    margin-bottom: 10px;
    width: 100%;
    text-align: left;
  }

  .sidebar a {
    width: 100%;
    margin: 5px 0;
    padding: 10px;
    text-align: left;
    font-size: 14px;
  }

  .content-area {
    width: 100%;
    padding: 60px 15px 15px 15px;
    gap: 15px;
  }

  /* Log panel */
  .log-panel {
    padding: 15px;
    margin-top: 15px;
    max-height: 350px;
    border-radius: 12px;
  }

  .log-entry {
    padding: 10px 12px;
  }

  .log-action {
    font-size: 14px;
  }

  .log-details {
    font-size: 13px;
  }

  .log-meta {
    font-size: 11px;
  }

  /* Tables - full responsive */
  .table-glass {
    font-size: 12px;
    border-radius: 8px;
  }

  .table-glass th, .table-glass td {
    padding: 8px;
    font-size: 12px;
  }

  .table-glass th {
    position: sticky;
    left: 0;
    z-index: 1;
  }

  /* Modal */
  .modal-content {
    padding: 20px 25px;
    max-width: 95%;
    border-radius: 12px;
  }

  .modal-close {
    right: 12px;
    top: 8px;
    font-size: 20px;
  }

  /* Alerts */
  .alert {
    padding: 10px 14px;
    font-size: 13px;
    border-radius: 8px;
  }

  /* Storage row */
  .storage-row {
    padding: 14px 16px;
    margin-bottom: 15px;
    border-radius: 12px;
  }

  .storage-row strong {
    font-size: 14px;
  }

  .storage-bar {
    height: 8px;
    margin: 8px 0 5px;
  }

  .storage-meta,
  .muted {
    font-size: 12px;
  }

  /* File panel */
  .file-panel {
    padding: 15px 12px;
  }
}

/* ========== SMALL PHONES (up to 400px) ========== */
@media (max-width: 400px) {
  /* Extra small adjustments */
  .login-container {
    padding: 25px 18px;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 17px;
  }

  h3 {
    font-size: 15px;
  }

  input, select {
    padding: 10px 12px;
    font-size: 13px;
  }

  button, input[type="submit"] {
    padding: 10px;
    font-size: 13px;
  }

  .sidebar {
    width: 240px;
    left: -260px;
  }

  .sidebar.active {
    left: 0;
  }

  .content-area {
    padding: 12px;
  }

  .log-panel {
    padding: 12px;
  }

  .table-glass th, .table-glass td {
    padding: 6px;
    font-size: 11px;
  }

  .modal-content {
    padding: 18px 20px;
  }

  .storage-row {
    padding: 12px 14px;
  }
}

/* ========== LANDSCAPE ORIENTATION (Phones & Small Tablets) ========== */
@media (max-height: 600px) and (orientation: landscape) {
  body {
    align-items: flex-start;
  }

  .login-container {
    margin: 10px auto;
    padding: 25px 30px;
  }

  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
  }

  .log-panel {
    max-height: 70vh;
  }
}

/* ========== TOUCH DEVICE OPTIMIZATIONS ========== */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets for touch devices */
  button, input[type="submit"], .sidebar a {
    min-height: 44px;
  }

  /* Remove hover effects on touch devices */
  button:hover {
    transform: none;
  }

  .sidebar a:hover {
    background: rgba(30, 144, 255, 0.15);
  }

  /* Better touch scrolling */
  .log-panel,
  .table-glass,
  .content-area {
    -webkit-overflow-scrolling: touch;
  }
}
