/* ========================================================
   CLIENT AUTH & CLOUD STORAGE UI STYLES
   ======================================================== */

/* Auth Topbar Elements */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  text-transform: none;
}

.auth-guest, .auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-auth-login {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #f3f0e9 !important;
}
.btn-auth-login:hover {
  background: rgba(255, 255, 255, 0.16) !important;
}

.btn-auth-register {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(232, 91, 42, 0.35) !important;
}
.btn-auth-register:hover {
  background: #ff6e3d !important;
  transform: translateY(-1px);
}

.btn-public-explore {
  background: rgba(30, 26, 22, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

.btn-my-photos {
  background: rgba(232, 91, 42, 0.12) !important;
  border-color: rgba(232, 91, 42, 0.35) !important;
  color: #ff9166 !important;
}
.btn-my-photos:hover {
  background: rgba(232, 91, 42, 0.22) !important;
}

.user-photos-badge {
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 4px;
}

/* User Pill & Dropdown */
.user-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  user-select: none;
  transition: all .2s ease;
}
.user-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent);
}

.user-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-transform: uppercase;
}
.user-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 11px;
  font-weight: 600;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f3f0e9;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: #1c1815;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.06);
  z-index: 1000;
  display: none;
  flex-direction: column;
  gap: 2px;
  text-transform: none;
}
.user-dropdown-menu.show {
  display: flex;
  animation: dropdownFade .2s cubic-bezier(.16, 1, .3, 1);
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-dropdown-header {
  padding: 8px 10px 6px;
  display: flex;
  flex-direction: column;
}
.user-dropdown-header strong {
  font-size: 13px;
  color: #f3f0e9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-header span {
  font-size: 11px;
  color: rgba(243, 240, 233, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-quota {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  margin: 4px 0 6px;
}
.quota-text {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(243, 240, 233, 0.7);
  margin-bottom: 4px;
}
.quota-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}
.quota-fill {
  height: 100%;
  background: linear-gradient(90deg, #e85b2a, #ff8a5c);
  border-radius: 999px;
  transition: width .3s ease;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  background: none;
  border: none;
  color: #f3f0e9;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.dropdown-item.text-danger {
  color: #ff6b6b;
}
.dropdown-item.text-danger:hover {
  background: rgba(255, 107, 107, 0.14);
}
.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 4px 0;
}

/* Auth Tabs Modal */
.auth-tabs {
  display: flex;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 20px;
}
.auth-tab-btn {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(243, 240, 233, 0.6);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.auth-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-pane {
  display: none;
}
.auth-pane.active {
  display: block;
}

/* Forms */
.form-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(243, 240, 233, 0.8);
  letter-spacing: .02em;
}
.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: #f3f0e9;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: all .2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 91, 42, 0.25);
}
.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: rgba(243, 240, 233, 0.6);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}
.btn-toggle-pwd:hover {
  color: #f3f0e9;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(243, 240, 233, 0.75);
  cursor: pointer;
  user-select: none;
}
.form-checkbox-label input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.form-hint {
  font-size: 10.5px;
  color: rgba(243, 240, 233, 0.55);
  line-height: 1.4;
}

.form-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 11.5px;
  margin-bottom: 14px;
  display: none;
  line-height: 1.4;
}
.form-alert.error {
  background: rgba(255, 87, 87, 0.15);
  border: 1px solid rgba(255, 87, 87, 0.4);
  color: #ff9e9e;
  display: block;
}
.form-alert.success {
  background: rgba(76, 217, 100, 0.15);
  border: 1px solid rgba(76, 217, 100, 0.4);
  color: #92f7aa;
  display: block;
}

/* Visibility Picker Cards */
.visibility-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.visibility-card {
  position: relative;
  cursor: pointer;
}
.visibility-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.visibility-card-inner {
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  transition: all .2s;
  height: 100%;
  box-sizing: border-box;
}
.visibility-card-icon {
  font-size: 16px;
}
.visibility-card-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #f3f0e9;
}
.visibility-card-desc {
  font-size: 9.5px;
  color: rgba(243, 240, 233, 0.55);
  line-height: 1.25;
}
.visibility-card input:checked + .visibility-card-inner {
  border-color: var(--accent);
  background: rgba(232, 91, 42, 0.15);
  box-shadow: 0 0 0 2px rgba(232, 91, 42, 0.3);
}

/* Visibility Badge in Lightbox */
.visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: .02em;
  margin-left: 8px;
}
.visibility-badge.private {
  background: rgba(255, 255, 255, 0.12);
  color: #e1dcd3;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.visibility-badge.public {
  background: rgba(64, 196, 255, 0.15);
  color: #80d8ff;
  border: 1px solid rgba(64, 196, 255, 0.35);
}
.visibility-badge.shared {
  background: rgba(255, 171, 64, 0.15);
  color: #ffd180;
  border: 1px solid rgba(255, 171, 64, 0.35);
}

/* Sessions Table */
.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin: 10px 0;
}
.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
}
.session-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.session-device {
  font-weight: 600;
  color: #f3f0e9;
}
.session-meta {
  font-size: 10px;
  color: rgba(243, 240, 233, 0.55);
}
.session-current-tag {
  background: rgba(76, 217, 100, 0.2);
  color: #7ef694;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
}

/* Gallery Filter Tabs */
.gallery-filter-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.gallery-filter-btn {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(243, 240, 233, 0.75);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}
.gallery-filter-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.gallery-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Upload Progress Modal Styles */
.upload-files-preview-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 14px;
}
.upload-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
}
.upload-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
  color: #f3f0e9;
}
.upload-file-size {
  color: rgba(243, 240, 233, 0.5);
  font-size: 10px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .auth-bar { gap: 6px; }
  .btn-public-explore span { display: none; }
  .btn-my-photos span:first-of-type { display: none; }
  .visibility-picker { grid-template-columns: 1fr; }
  .user-name { max-width: 70px; }
  .user-dropdown-menu { right: 0; max-width: calc(100vw - 20px); width: 230px; }
  .form-input, .form-textarea, .form-select, .gallery-search { font-size: 16px !important; }
  .auth-tabs { margin-bottom: 14px; }
  .auth-tab-btn { padding: 8px 0; font-size: 12px; }
}

/* Mode Status Badge */
.mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  user-select: none;
}
.mode-badge:hover {
  transform: translateY(-1px);
}
.mode-badge .mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.mode-badge.server {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.mode-badge.server .mode-dot {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}
.mode-badge.local {
  background: rgba(234, 179, 8, 0.12);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.3);
}
.mode-badge.local .mode-dot {
  background: #eab308;
  box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
}
.mode-badge.checking {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.mode-badge.checking .mode-dot {
  background: #aaa;
  animation: pulse 1s infinite alternate;
}
@keyframes pulse {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

/* Server Config Box */
.server-config-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}
.server-config-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
}

/* Auth Engine Indicator Banner */
.auth-engine-banner {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}
.auth-engine-banner.server {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #86efac;
}
.auth-engine-banner.local {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.25);
  color: #fde047;
}
.auth-engine-banner.checking {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}
.auth-engine-banner .engine-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.auth-engine-banner .engine-dot.server {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
}
.auth-engine-banner .engine-dot.local {
  background: #eab308;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.7);
}
.auth-engine-banner .engine-dot.checking {
  background: #aaa;
  animation: pulse 1s infinite alternate;
}


