/* ==========================================================================
   LnwRod Shared Core Styles (common.css)
   ========================================================================== */

:root {
  --font-main: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-dark: #0b0f14;
  --bg-card: #151b22;
  --bg-input: #0d1117;
  --primary: #ff641e;
  --primary-hover: #ea580c;
  --primary-rgb: 255, 100, 30;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #30363d;
  --border-hover: #484f58;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

html, body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography & Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--primary-hover);
}

/* Form Inputs */
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25);
}
input::placeholder, textarea::placeholder {
  color: #64748b;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.rs-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .rs-two { grid-template-columns: 1fr; }
}

.rs-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.rs-password-wrapper input {
  padding-right: 42px;
}
.rs-toggle-pw {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rs-toggle-pw:hover {
  color: var(--text-main);
}

/* Buttons */
.rs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #21262d;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1.2;
}
.rs-btn:hover {
  background: #30363d;
  border-color: var(--border-hover);
}
.rs-btn:disabled, .rs-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.rs-btn.rs-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #111;
}
.rs-btn.rs-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}
.rs-btn.rs-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.rs-btn.rs-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.rs-btn.rs-wide {
  width: 100%;
}
.rs-btn.rs-loading {
  position: relative;
  color: transparent !important;
}
.rs-btn.rs-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: rs-spin 0.8s linear infinite;
}

/* Status Chips */
.rs-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
}

/* Dialogs */
.rs-dialog {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 24px;
  max-width: 580px;
  width: 92%;
  margin: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  position: fixed;
  inset: 0;
  z-index: 9999;
}
.rs-dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}
.rs-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.rs-dialog-head h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}
.rs-dialog-close, .rs-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
}
.rs-dialog-close:hover, .rs-close:hover {
  color: #fff;
  background: #30363d;
}

/* Video Call Modal (In-Browser WebRTC) */
.rs-video-modal {
  width: 95vw;
  max-width: 960px;
  height: 90vh;
  max-height: 820px;
  background: #0b0f14;
  border: 1.5px solid #334155;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  display: none;
  flex-direction: column;
}
.rs-video-modal[open] {
  display: flex;
}
.rs-video-modal::backdrop {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}
.rs-video-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: #151b22;
  border-bottom: 1px solid #283038;
  flex-shrink: 0;
  gap: 10px;
}
.rs-video-modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f1f5f9;
  font-size: 14px;
  flex-wrap: wrap;
}
.rs-video-pulse {
  color: #10b981;
  font-size: 16px;
  animation: rs-pulse 1.5s infinite;
}
.rs-btn-hangup {
  background: #dc2626 !important;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.rs-btn-hangup:hover {
  background: #b91c1c !important;
}
.rs-video-container {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 360px;
  background: #000;
  position: relative;
}
.rs-video-container iframe {
  border: none;
  width: 100%;
  height: 100%;
}
.rs-btn-header-video {
  background: #059669;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}
.rs-btn-header-video:hover {
  background: #047857;
}

/* Toast Notification */
.rs-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 100000;
  max-width: 90vw;
  text-align: center;
  animation: rs-fade-in 0.25s ease-out;
}

/* Helpers & Utilities */
.rs-muted {
  color: var(--text-muted);
  font-size: 13px;
}
.rs-notice {
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  color: #ffb181;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0;
}
.rs-orange {
  color: var(--primary);
}

/* Animations */
@keyframes rs-spin {
  to { transform: rotate(360deg); }
}
@keyframes rs-pulse {
  0% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.4; transform: scale(0.95); }
}
@keyframes rs-fade-in {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
