/* ==============================
   WOAIL Cloud - Custom Styles
   ============================== */

/* ---- Auth Page Container ---- */
.auth-page-container {
  min-height: 100vh;
  background: #F8FAFC;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

/* Auth Background Glows */
.auth-glow-blue {
  background: radial-gradient(circle, rgba(79,124,255,0.12) 0%, transparent 70%);
  animation: authGlowPulse 8s ease-in-out infinite;
}
.auth-glow-purple {
  background: radial-gradient(circle, rgba(139,92,246,0.10) 0%, transparent 70%);
  animation: authGlowPulse 10s ease-in-out infinite reverse;
}
@keyframes authGlowPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Auth Control Buttons (theme + lang) */
.auth-ctrl-btn {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(15,23,42,0.06);
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s ease;
}
.auth-ctrl-btn:hover {
  background: rgba(255,255,255,0.85);
  color: #1E293B;
}
.auth-icon-dark { display: none; }
.dark .auth-icon-dark { display: block; }
.dark .auth-icon-light { display: none; }

/* System Status */
.auth-status {
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.6);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(15,23,42,0.06);
}

/* Left Panel */
.auth-left-panel {
  background: linear-gradient(180deg, rgba(248,250,252,0) 0%, rgba(79,124,255,0.02) 50%, rgba(139,92,246,0.02) 100%);
}

/* Cloud SVG Paths */
.cloud-path-back { fill: rgba(255,255,255,0.4); stroke: rgba(79,124,255,0.12); stroke-width: 1.5; }
.cloud-path-front { fill: rgba(255,255,255,0.6); stroke: rgba(139,92,246,0.1); stroke-width: 1.5; }

/* Glass Cloud Scene */
.auth-cloud-scene {
  filter: drop-shadow(0 20px 60px rgba(79,124,255,0.1));
  overflow: visible;
}

/* Floating Icons */
.auth-float-icon {
  position: absolute;
  animation: authIconFloat 6s ease-in-out infinite;
  z-index: 2;
}
.auth-icon-chip {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(15,23,42,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.04);
  transition: transform 0.3s ease;
}
.auth-icon-chip:hover { transform: scale(1.15); }
.auth-icon-chip span { font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
@keyframes authIconFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-10px) rotate(1.5deg); }
  50% { transform: translateY(-18px) rotate(0deg); }
  75% { transform: translateY(-8px) rotate(-1.5deg); }
}

/* Stat Cards */
.auth-stat-card {
  backdrop-filter: blur(16px);
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s ease;
}
.auth-stat-card:hover {
  background: rgba(255,255,255,0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.04);
}

/* Tech Tags */
.auth-tech-tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  color: #64748B;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 20px;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}
.auth-tech-tag:hover {
  background: rgba(255,255,255,0.8);
  color: #4F7CFF;
  border-color: rgba(79,124,255,0.15);
}

/* Login Card */
.auth-login-card {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 8px 40px rgba(0,0,0,0.06), 0 0 0 1px rgba(255,255,255,0.5) inset;
}

/* Tab Bar */
.auth-tab-bar {
  background: rgba(241,245,249,0.8);
  border: 1px solid rgba(15,23,42,0.04);
}
.auth-tab.active {
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  color: #1E293B;
}
.auth-tab:not(.active) { color: #94A3B8; }
.auth-tab:not(.active):hover { color: #64748B; }

/* Auth Inputs */
.auth-input {
  height: 52px;
  background: rgba(255,255,255,0.8);
  border: 1.5px solid rgba(15,23,42,0.08);
  color: #1E293B;
  transition: all 0.2s ease;
}
.auth-input:focus {
  border-color: #4F7CFF;
  background: white;
  box-shadow: 0 0 0 4px rgba(79,124,255,0.08);
}
.auth-input::placeholder { color: #CBD5E1; }

/* Submit Button */
.auth-submit-btn {
  background: linear-gradient(135deg, #4F7CFF 0%, #8B5CF6 100%);
  background-size: 200% 200%;
  box-shadow: 0 4px 15px rgba(79,124,255,0.25);
  animation: authBtnGradient 4s ease infinite;
  letter-spacing: 0.3px;
}
.auth-submit-btn:hover {
  box-shadow: 0 8px 30px rgba(79,124,255,0.35);
  transform: translateY(-1px);
}
.auth-submit-btn:active { transform: translateY(0); }
.auth-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
@keyframes authBtnGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Workspace Preview */
.auth-workspace-preview {
  background: rgba(248,250,252,0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(15,23,42,0.06);
}
.auth-preview-item { background: rgba(255,255,255,0.6); }

/* Invitation Modal */
.invite-modal-card {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.12), 0 0 0 1px rgba(255,255,255,0.5) inset;
  animation: inviteSlideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes inviteSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ================================
   DARK MODE — Auth Page
   ================================ */
.dark .auth-page-container { background: #0F172A; }
.dark .auth-glow-blue { background: radial-gradient(circle, rgba(79,124,255,0.14) 0%, transparent 70%); }
.dark .auth-glow-purple { background: radial-gradient(circle, rgba(139,92,246,0.12) 0%, transparent 70%); }

.dark .auth-ctrl-btn {
  background: rgba(30,41,59,0.7);
  border-color: rgba(148,163,184,0.1);
  color: #94A3B8;
}
.dark .auth-ctrl-btn:hover {
  background: rgba(30,41,59,0.9);
  color: #E2E8F0;
}
.dark .auth-status {
  background: rgba(30,41,59,0.7);
  border-color: rgba(148,163,184,0.1);
}
.dark .auth-left-panel {
  background: linear-gradient(180deg, transparent 0%, rgba(79,124,255,0.03) 50%, rgba(139,92,246,0.03) 100%);
}
.dark .cloud-path-back { fill: rgba(30,41,59,0.5); stroke: rgba(79,124,255,0.15); }
.dark .cloud-path-front { fill: rgba(30,41,59,0.7); stroke: rgba(139,92,246,0.12); }
.dark .auth-icon-chip {
  background: rgba(30,41,59,0.7);
  border-color: rgba(148,163,184,0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}
.dark .auth-stat-card {
  background: rgba(30,41,59,0.5);
  border-color: rgba(148,163,184,0.08);
}
.dark .auth-stat-card:hover {
  background: rgba(30,41,59,0.7);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}
.dark .auth-tech-tag {
  background: rgba(30,41,59,0.5);
  border-color: rgba(148,163,184,0.08);
  color: #94A3B8;
}
.dark .auth-tech-tag:hover {
  background: rgba(30,41,59,0.7);
  color: #818CF8;
}
.dark .auth-login-card {
  background: rgba(30,41,59,0.65);
  border-color: rgba(148,163,184,0.08);
  box-shadow: 0 8px 40px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.04) inset;
}
.dark .auth-tab-bar {
  background: rgba(15,23,42,0.6);
  border-color: rgba(148,163,184,0.06);
}
.dark .auth-tab.active {
  background: rgba(51,65,85,0.8);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  color: #F1F5F9;
}
.dark .auth-tab:not(.active) { color: #64748B; }
.dark .auth-tab:not(.active):hover { color: #94A3B8; }
.dark .auth-input {
  background: rgba(15,23,42,0.6);
  border-color: rgba(148,163,184,0.1);
  color: #F1F5F9;
}
.dark .auth-input:focus {
  border-color: #818CF8;
  background: rgba(15,23,42,0.8);
  box-shadow: 0 0 0 4px rgba(129,140,248,0.1);
}
.dark .auth-input::placeholder { color: #475569; }
.dark .auth-workspace-preview {
  background: rgba(30,41,59,0.5);
  border-color: rgba(148,163,184,0.08);
}
.dark .auth-preview-item { background: rgba(15,23,42,0.5); }
.dark .invite-modal-card {
  background: rgba(30,41,59,0.9);
  border-color: rgba(148,163,184,0.08);
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.3);
}

/* ---- Auth Responsive ---- */
@media (max-width: 1023px) {
  .auth-page-container { overflow-y: auto; }
  .auth-page-container > .relative { min-height: 100vh; }
}

/* ---- Base & Typography ---- */
* {
  box-sizing: border-box;
}

body {
  overflow: hidden;
}

::selection {
  background: rgba(79, 124, 255, 0.2);
  color: inherit;
}

/* ---- Scrollbar ---- */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#page-content::-webkit-scrollbar {
  width: 6px;
}
#page-content::-webkit-scrollbar-track {
  background: transparent;
}
#page-content::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}
#page-content::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

.dark #page-content::-webkit-scrollbar-thumb {
  background: rgba(71, 85, 105, 0.4);
}

/* ---- Sidebar ---- */
.sidebar {
  position: relative;
}

@media (max-width: 1023px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 30;
  }
  .sidebar.open {
    transform: translateX(0);
  }
}

/* ---- Navigation Items ---- */
.nav-item {
  color: rgb(100, 116, 139);
}
.dark .nav-item {
  color: rgb(148, 163, 184);
}

.nav-item:hover {
  background: rgb(241, 245, 249);
  color: rgb(30, 41, 59);
}
.dark .nav-item:hover {
  background: rgba(51, 65, 85, 0.5);
  color: rgb(241, 245, 249);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.1), rgba(139, 92, 246, 0.1));
  color: #4F7CFF;
}
.dark .nav-item.active {
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.15), rgba(139, 92, 246, 0.15));
  color: #818CF8;
}

.nav-item.active i {
  color: #4F7CFF;
}
.dark .nav-item.active i {
  color: #818CF8;
}

/* ---- Logo Gradient ---- */
.logo-gradient {
  background: linear-gradient(135deg, #4F7CFF, #8B5CF6);
}

/* ---- Storage Bar Animation ---- */
.storage-bar-fill {
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Stat Cards Hover ---- */
.stat-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover {
  transform: translateY(-2px);
}

/* ---- File Cards ---- */
.file-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.file-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.08), 0 4px 10px -5px rgba(0, 0, 0, 0.04);
}
.dark .file-card:hover {
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.3), 0 4px 10px -5px rgba(0, 0, 0, 0.2);
}

.file-card.selected {
  ring: 2px;
  ring-color: #4F7CFF;
  border-color: #4F7CFF;
}

/* ---- Photo Grid ---- */
.photo-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.photo-item:hover {
  transform: scale(1.02);
}
.photo-item:hover .photo-overlay {
  opacity: 1;
}
.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

/* ---- Video Card ---- */
.video-card {
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}
.video-card:hover .video-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
}
.video-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s;
}

/* ---- Modals ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-container {
  background: white;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.dark .modal-container {
  background: rgb(30, 41, 59);
  border: 1px solid rgba(51, 65, 85, 0.5);
}

/* ---- Upload Dropzone ---- */
#upload-dropzone.dragover {
  border-color: #4F7CFF;
  background: rgba(79, 124, 255, 0.05);
}

/* ---- Upload Progress Bar ---- */
.upload-progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgb(226, 232, 240);
  overflow: hidden;
}
.dark .upload-progress-bar {
  background: rgb(51, 65, 85);
}
.upload-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #4F7CFF, #8B5CF6);
  transition: width 0.3s ease;
}

/* ---- Toast Notifications ---- */
.toast {
  padding: 0.875rem 1.25rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 360px;
}
.toast-success {
  background: white;
  color: rgb(22, 163, 74);
  border: 1px solid rgba(22, 163, 74, 0.2);
}
.dark .toast-success {
  background: rgb(30, 41, 59);
  border-color: rgba(22, 163, 74, 0.3);
}
.toast-error {
  background: white;
  color: rgb(220, 38, 38);
  border: 1px solid rgba(220, 38, 38, 0.2);
}
.dark .toast-error {
  background: rgb(30, 41, 59);
  border-color: rgba(220, 38, 38, 0.3);
}
.toast-info {
  background: white;
  color: rgb(79, 124, 255);
  border: 1px solid rgba(79, 124, 255, 0.2);
}
.dark .toast-info {
  background: rgb(30, 41, 59);
  border-color: rgba(79, 124, 255, 0.3);
}

/* ---- VIP Badge ---- */
.vip-badge {
  background: linear-gradient(135deg, #4F7CFF, #8B5CF6);
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ---- Welcome Card ---- */
.welcome-card {
  box-shadow: 0 8px 30px -5px rgba(79, 124, 255, 0.3);
}
.dark .welcome-card {
  box-shadow: 0 8px 30px -5px rgba(79, 124, 255, 0.15);
}

/* ---- AI Card ---- */
.ai-card {
  transition: all 0.3s;
}
.ai-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.15);
}

/* ---- Context Menu ---- */
.context-menu-item:active {
  transform: scale(0.98);
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* ---- View Transitions ---- */
.view-section {
  animation: viewFadeIn 0.3s ease;
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Checkbox Style ---- */
input[type="checkbox"] {
  accent-color: #4F7CFF;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ---- Table Row Hover ---- */
tbody tr {
  transition: background-color 0.15s;
}
tbody tr:hover {
  background: rgb(248, 250, 252);
}
.dark tbody tr:hover {
  background: rgba(51, 65, 85, 0.3);
}

/* ---- Select styling ---- */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  #page-content {
    padding: 1rem;
  }
  .welcome-card {
    padding: 1.5rem;
  }
  .welcome-card h2 {
    font-size: 1.25rem;
  }
}

/* ---- Focus Visible ---- */
*:focus-visible {
  outline: 2px solid #4F7CFF;
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(79, 124, 255, 0.2);
  border-top-color: #4F7CFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- File Type Icon Colors ---- */
.file-icon-image { color: #3B82F6; }
.file-icon-document { color: #F59E0B; }
.file-icon-video { color: #8B5CF6; }
.file-icon-music { color: #10B981; }
.file-icon-other { color: #64748B; }
.file-icon-folder { color: #F59E0B; }