/* ─────────────────────────────────────────────
   SDP Author Marketing Planner — Plugin Styles
   ───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@700;900&display=swap');

:root {
  --sdp-green:     #1a5c2a;
  --sdp-green-lt:  #f0fdf4;
  --sdp-lavender:  #e0d4f0;
  --sdp-purple:    #c8b4e0;
  --sdp-pink:      #ff69b4;
  --sdp-pink-lt:   #fdf2f8;
  --sdp-text:      #2d3748;
  --sdp-muted:     #6b7280;
  --sdp-border:    #e0d4f0;
  --sdp-white:     #ffffff;
  --sdp-radius:    10px;
  --sdp-shadow:    0 2px 8px rgba(0,0,0,.08);
  --sdp-font:      'DM Sans', sans-serif;
  --sdp-serif:     'Playfair Display', serif;
}

/* ── Wrapper ── */
#sdp-planner-root {
  font-family: var(--sdp-font);
  color: var(--sdp-text);
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

/* ── Save bar ── */
#sdp-save-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--sdp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
  font-size: .85rem;
  gap: 1rem;
}

#sdp-save-status {
  padding: .25rem .75rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: .8rem;
  transition: background .3s, color .3s;
}
.sdp-status-saved    { background: #dcfce7; color: #166534; }
.sdp-status-saving   { background: #fef9c3; color: #854d0e; }
.sdp-status-error    { background: #fee2e2; color: #991b1b; }

.sdp-print-btn {
  background: var(--sdp-green);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .35rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sdp-font);
  transition: background .2s;
}
.sdp-print-btn:hover { background: #134a20; }

/* ── Header ── */
.sdp-header {
  text-align: center;
  padding: 2rem 1rem 1.5rem;
  background: linear-gradient(to bottom, #f0fdf4, transparent);
  border-radius: 0 0 var(--sdp-radius) var(--sdp-radius);
  margin-bottom: 1rem;
}
.sdp-logo { width: 100px; height: auto; margin-bottom: .75rem; }
.sdp-footer-logo { width: 64px; height: auto; margin-bottom: .75rem; }
.sdp-header h1 {
  font-family: var(--sdp-serif);
  color: var(--sdp-green);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  margin: 0 0 .5rem;
}
.sdp-header p { color: var(--sdp-muted); max-width: 540px; margin: 0 auto; }

/* ── Tabs ── */
.sdp-tabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  padding: .75rem 0;
  position: sticky;
  top: 2.6rem;
  z-index: 90;
  background: #fff;
  border-bottom: 1px solid var(--sdp-border);
  margin-bottom: 1.5rem;
}
.sdp-tab {
  padding: .35rem .9rem;
  border-radius: 999px;
  border: 1.5px solid var(--sdp-border);
  background: #f9f9f9;
  font-family: var(--sdp-font);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  color: var(--sdp-text);
}
.sdp-tab:hover  { border-color: var(--sdp-green); color: var(--sdp-green); }
.sdp-tab.active { background: var(--sdp-green); color: #fff; border-color: var(--sdp-green); }

/* ── Sections ── */
.sdp-section { display: none; }
.sdp-section.active { display: block; }
.sdp-section h2 {
  font-family: var(--sdp-serif);
  color: var(--sdp-green);
  font-size: 1.5rem;
  margin-bottom: .25rem;
}
.sdp-intro { color: var(--sdp-muted); margin-bottom: 1.5rem; font-size: .95rem; }

/* ── Card ── */
.sdp-card {
  background: var(--sdp-white);
  border: 1.5px solid var(--sdp-border);
  border-radius: var(--sdp-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--sdp-shadow);
}
.sdp-card h3 {
  font-family: var(--sdp-serif);
  color: var(--sdp-green);
  font-size: 1.05rem;
  margin: 0 0 1rem;
}

/* ── Profile layout ── */
.sdp-profile-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.sdp-profile-fields { flex: 1; min-width: 0; }

/* ── Photo upload ── */
.sdp-photo-wrap { flex-shrink: 0; }
.sdp-photo-box {
  width: 180px;
  height: 180px;
  border: 2px solid var(--sdp-purple);
  border-radius: var(--sdp-radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  position: relative;
}
.sdp-photo-box img { width: 100%; height: 100%; object-fit: cover; }
#sdp-photo-placeholder {
  text-align: center;
  padding: 1rem;
  font-size: .82rem;
  color: var(--sdp-muted);
}
#sdp-photo-placeholder span { font-size: 2rem; display: block; margin-bottom: .4rem; }
#sdp-photo-placeholder p { margin: 0 0 .5rem; }
#sdp-photo-btn {
  background: #e5e7eb;
  border: none;
  border-radius: 5px;
  padding: .3rem .8rem;
  font-size: .78rem;
  cursor: pointer;
  font-family: var(--sdp-font);
}
#sdp-photo-btn:hover { background: #d1d5db; }
.sdp-photo-hint { font-size: .72rem; color: #9ca3af; margin-top: .35rem; }
.sdp-photo-msg  { font-size: .78rem; margin-top: .25rem; }
.sdp-photo-msg.success { color: #166534; }
.sdp-photo-msg.error   { color: #991b1b; }

/* ── Fields ── */
.sdp-field { margin-bottom: 1rem; }
.sdp-field label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sdp-muted);
  margin-bottom: .3rem;
}
.sdp-field input[type="text"],
.sdp-field textarea {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--sdp-purple);
  background: transparent;
  padding: .35rem .15rem;
  font-family: var(--sdp-font);
  font-size: .92rem;
  color: var(--sdp-text);
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s;
}
.sdp-field textarea {
  border: 1.5px solid var(--sdp-purple);
  border-radius: 7px;
  padding: .5rem .65rem;
  resize: none;
  min-height: 56px;
  overflow-y: hidden;   /* hide scrollbar; JS controls height */
  box-sizing: border-box;
  display: block;
}
.sdp-field input[type="text"]:focus,
.sdp-field textarea:focus { border-color: var(--sdp-pink); }

.sdp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}
@media (max-width: 600px) { .sdp-grid-2 { grid-template-columns: 1fr; } }

.sdp-counter { font-size: .75rem; color: var(--sdp-muted); margin-top: .2rem; }
.sdp-hint    { font-size: .84rem; color: var(--sdp-muted); margin-bottom: .75rem; }

/* ── Platform cards (Trends section) ── */
.sdp-platform-card {
  background: #fff;
  border: 1.5px solid var(--sdp-border);
  border-radius: var(--sdp-radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--sdp-shadow);
}
.sdp-platform-card h3 { font-family: var(--sdp-serif); color: var(--sdp-green); margin: .5rem 0 .6rem; font-size: 1rem; }
.sdp-platform-card ul { padding-left: 1.2rem; margin: 0; }
.sdp-platform-card li { font-size: .88rem; margin-bottom: .35rem; color: var(--sdp-text); }

.sdp-badge {
  display: inline-block;
  padding: .2rem .75rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
}
.badge-tiktok    { background: #010101; }
.badge-instagram { background: linear-gradient(to right, #9b59b6, #ff69b4); }
.badge-facebook  { background: #1877f2; }
.badge-youtube   { background: #ff0000; }
.badge-threads   { background: #374151; }

/* ── Pillars ── */
.sdp-pillar {
  display: flex;
  gap: 1rem;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: .75rem;
  align-items: flex-start;
}
.sdp-pillar h4 { margin: 0 0 .35rem; color: var(--sdp-green); font-size: .95rem; }
.sdp-pillar p  { margin: 0 0 .3rem; font-size: .85rem; }
.sdp-pillar-pct { font-size: 1.6rem; font-weight: 900; flex-shrink: 0; line-height: 1; padding-top: .1rem; }
.sdp-pillar-fun  { background: #f3e8ff; }
.sdp-pillar-fun  .sdp-pillar-pct { color: #7c3aed; }
.sdp-pillar-edu  { background: #f0fdf4; }
.sdp-pillar-edu  .sdp-pillar-pct { color: var(--sdp-green); }
.sdp-pillar-book { background: var(--sdp-pink-lt); }
.sdp-pillar-book .sdp-pillar-pct { color: var(--sdp-pink); }
.sdp-examples    { font-size: .78rem; color: var(--sdp-muted); }

/* ── Book entries ── */
.sdp-book-entry {
  background: #fff;
  border: 1.5px solid var(--sdp-border);
  border-radius: var(--sdp-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--sdp-shadow);
}
.sdp-book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.sdp-book-header h3 { font-family: var(--sdp-serif); color: var(--sdp-green); margin: 0; font-size: 1rem; }
.sdp-delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.1rem;
  padding: .1rem .4rem;
  border-radius: 4px;
  transition: background .15s;
}
.sdp-delete-btn:hover { background: #fee2e2; }

.sdp-hashtag-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-top: .75rem;
}
@media (max-width: 500px) { .sdp-hashtag-grid { grid-template-columns: 1fr 1fr; } }
.sdp-hashtag-grid input {
  border: none;
  border-bottom: 1.5px solid var(--sdp-purple);
  background: transparent;
  font-family: var(--sdp-font);
  font-size: .82rem;
  padding: .25rem .1rem;
  width: 100%;
  outline: none;
}
.sdp-hashtag-grid input:focus { border-bottom-color: var(--sdp-pink); }

.sdp-add-btn {
  background: var(--sdp-green);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: .6rem 1.4rem;
  font-family: var(--sdp-font);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s;
}
.sdp-add-btn:hover { background: #134a20; }

/* ── Post idea rows ── */
.sdp-post-idea-row {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}
.sdp-post-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--sdp-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: var(--sdp-green);
  margin-top: .35rem;
  background: #fff;
}
.sdp-post-idea-row .sdp-field { flex: 1; margin: 0; }

/* ── Calendar ── */
.sdp-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.sdp-cal-nav h3 { font-family: var(--sdp-serif); color: var(--sdp-green); margin: 0; }
.sdp-cal-nav button {
  background: #e5e7eb;
  border: none;
  border-radius: 5px;
  width: 32px; height: 32px;
  font-size: 1.2rem;
  cursor: pointer;
  font-family: var(--sdp-font);
}
.sdp-cal-nav button:hover { background: #d1d5db; }

.sdp-cal-card { padding: .75rem; overflow-x: auto; }
.sdp-cal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.sdp-cal-table thead th {
  text-align: left;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sdp-muted);
  padding: .35rem .4rem;
  border-bottom: 1.5px solid var(--sdp-border);
}
.sdp-cal-day-col  { width: 36px; }
.sdp-cal-time-col { width: 80px; }
.sdp-cal-plat-col { width: 100px; }

.sdp-cal-table tbody tr:nth-child(even) { background: #f9fafb; }
.sdp-cal-table td { padding: .2rem .4rem; vertical-align: middle; }
.sdp-cal-table td:first-child { font-weight: 700; color: var(--sdp-green); font-size: .8rem; }
.sdp-cal-table textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--sdp-purple);
  background: transparent;
  font-family: var(--sdp-font);
  font-size: .8rem;
  padding: .15rem .1rem;
  outline: none;
  resize: none;
  overflow-y: hidden;   /* hide scrollbar; JS controls height */
  min-height: 22px;
  line-height: 1.4;
  box-sizing: border-box;
  display: block;
}
.sdp-cal-table textarea:focus { border-bottom-color: var(--sdp-pink); }

/* ── Analysis entries ── */
.sdp-analysis-entry {
  background: #fff;
  border: 1.5px solid var(--sdp-border);
  border-radius: var(--sdp-radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--sdp-shadow);
}

/* ── Login notice ── */
.sdp-login-notice {
  background: #fffbeb;
  border: 1.5px solid #f59e0b;
  border-radius: var(--sdp-radius);
  padding: 1.5rem;
  text-align: center;
  font-family: var(--sdp-font);
}

/* ── Footer ── */
.sdp-footer {
  text-align: center;
  padding: 2.5rem 1rem 1rem;
  color: var(--sdp-muted);
  font-size: .85rem;
}
.sdp-footer a { color: var(--sdp-pink); text-decoration: none; }

/* ── Print overrides ── */
@media print {

  /* ── Hide elearning theme chrome (from inspector body classes) ── */
  .site-header, #masthead,
  .site-footer, #colophon,
  .widget-area, #secondary,
  .main-navigation, #site-navigation,
  .breadcrumb-trail, .entry-header,
  .post-navigation, .page-navigation,
  .admin-bar, #wpadminbar,
  .ur-frontend-form, .user-registration,
  a[href*="wp-admin"], .edit-link,
  .post-edit-link, #wp-toolbar { display: none !important; }

  /* ── Force content area full width ── */
  #primary, .content-area { width: 100% !important; float: none !important; max-width: 100% !important; padding: 0 !important; }
  #content, .site-content { width: 100% !important; padding: 0 !important; margin: 0 !important; }

  /* ── Remove big white gaps between sections ── */
  .entry-content, .entry-content > * { margin-bottom: 0 !important; padding-bottom: 0 !important; }
  #sdp-planner-root .sdp-section { page-break-after: always; margin: 0 !important; padding-top: .5rem !important; }

  /* ── Hide plugin UI chrome ── */
  #sdp-save-bar, .sdp-tabs, .sdp-add-btn,
  .sdp-delete-btn, .sdp-print-btn,
  .sdp-cal-nav button { display: none !important; }

  /* ── Cards ── */
  .sdp-card, .sdp-book-entry, .sdp-analysis-entry, .sdp-platform-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
    overflow: visible !important;
    margin-bottom: .5rem !important;
  }

  /* ── Textareas: field-sizing is Chrome 123+ native auto-height ── */
  #sdp-planner-root textarea {
    field-sizing: content !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
  }

  /* ── Calendar ── */
  .sdp-cal-card { overflow: visible !important; }
  .sdp-cal-table { width: 100% !important; table-layout: fixed !important; }
  .sdp-cal-day-col  { width: 28px !important; }
  .sdp-cal-time-col { width: 70px !important; }
  .sdp-cal-plat-col { width: 90px !important; }
  .sdp-cal-table td { padding: 3px 4px !important; vertical-align: top !important; }

  /* ── Colours ── */
  .sdp-section h2, .sdp-card h3, .sdp-book-header h3 {
    color: #1a5c2a !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .sdp-pillar-fun  { background: #f3e8ff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sdp-pillar-edu  { background: #f0fdf4 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sdp-pillar-book { background: #fdf2f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* ── Footer ── */
  .sdp-footer { padding: .5rem 0 0 !important; font-size: 9pt !important; }
}
