/* ============================================================
   DoNet Social Mockup - Mobile Stylesheet (Touch Optimized)
   ============================================================ */

:root {
  --sm-primary: #1d9bf0;
  --sm-primary-hover: #1a8cd8;
  --sm-dark: #0f172a;
  --sm-border: #e2e8f0;
  --sm-text: #0f172a;
  --sm-text-muted: #64748b;
  --sm-surface: #ffffff;
  --sm-bg: #f8fafc;
  --sm-radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background-color: var(--sm-bg);
  color: var(--sm-text);
  min-height: 100vh;
  padding-bottom: calc(75px + env(safe-area-inset-bottom, 16px));
}

.m-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sm-border);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--sm-text);
  text-decoration: none;
}

.m-header-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--sm-dark);
}

.m-header-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Viewport Preview Area */
.m-preview-section {
  padding: 0.75rem 1rem;
}

.m-preview-card {
  background: #0f172a;
  background-image: radial-gradient(#334155 1px, transparent 1px);
  background-size: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--sm-border);
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: auto;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.08);
}

.sm-mockup-frame {
  max-width: 100%;
  padding: 16px 8px;
  border-radius: 16px;
  display: inline-flex;
}

.sm-device-card {
  width: 100% !important;
  max-width: 360px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  font-size: 0.9rem;
}

/* Horizontal Fast Actions */
.m-action-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.m-action-bar::-webkit-scrollbar {
  display: none;
}

.m-tool-pill {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #ffffff;
  border: 1px solid var(--sm-border);
  color: var(--sm-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.m-tool-pill.active {
  background: var(--sm-primary);
  color: #ffffff;
  border-color: var(--sm-primary);
}

/* Tab Navigation */
.m-tab-nav {
  display: flex;
  border-bottom: 1px solid var(--sm-border);
  background: #ffffff;
  padding: 0 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.m-tab-nav::-webkit-scrollbar {
  display: none;
}

.m-tab-btn {
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sm-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.m-tab-btn.active {
  color: var(--sm-primary);
  border-bottom-color: var(--sm-primary);
}

/* Tab Panels */
.m-tab-panel {
  display: none;
  padding: 1rem;
  flex-direction: column;
  gap: 1rem;
}

.m-tab-panel.active {
  display: flex;
}

.m-card {
  background: #ffffff;
  border-radius: var(--sm-radius);
  border: 1px solid var(--sm-border);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.m-card-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--sm-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.m-btn-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.m-btn-sub {
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid var(--sm-border);
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sm-text);
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.m-btn-sub.active {
  border-color: var(--sm-primary);
  background: #f0f9ff;
  color: var(--sm-primary);
}

.m-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--sm-border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--sm-dark);
  outline: none;
  box-sizing: border-box;
}

.m-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--sm-border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--sm-dark);
  outline: none;
  min-height: 70px;
  box-sizing: border-box;
  font-family: inherit;
}

.m-select {
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--sm-border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--sm-dark);
  background: #ffffff;
  outline: none;
}

/* Fixed Bottom Action Bar */
.m-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--sm-border);
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
}

.m-bottom-export-btn {
  flex: 1;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.75rem;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.m-bottom-export-btn:active {
  transform: scale(0.98);
}
