/* ====================================
   NoteOnline - style.css
   ==================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #3b82f6;
  --primary-d: #2563eb;
  --danger: #ef4444;
  --danger-d: #dc2626;
  --outline: #6b7280;
  --bg: #f0f9ff;
  --surface: #ffffff;
  --border: #bfdbfe;
  --text: #1e293b;
  --muted: #64748b;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(59, 130, 246, .10);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* ---- Layout ---- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  flex: 1;
  width: 100%;
}

/* ---- Header ---- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0 .8rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -.5px;
}

.logo:hover {
  color: var(--primary-d);
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
  margin-left: 1.2rem;
  transition: color .2s;
}

nav a:hover {
  color: var(--primary);
}

/* ---- Notifications ---- */
.alert {
  padding: .7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .9rem;
  font-weight: 500;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ---- Editor card ---- */
.editor-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.editor-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: .35rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #f8fafc;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
  background: #fff;
}

textarea {
  min-height: 320px;
}

/* ---- Buttons ---- */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1.1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem 1.2rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background .2s, transform .1s, box-shadow .2s;
}

.btn:active {
  transform: scale(.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-d);
  box-shadow: 0 4px 14px rgba(59, 130, 246, .35);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-d);
  box-shadow: 0 4px 14px rgba(239, 68, 68, .3);
}

.btn-outline {
  background: transparent;
  color: var(--outline);
  border-color: var(--border);
}

.btn-outline:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--outline);
}

.btn-new {
  background: #10b981;
  color: #fff;
}

.btn-new:hover {
  background: #059669;
}

/* ---- Recent notes list ---- */
.notes-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .9rem;
  color: var(--text);
}

.notes-list {
  list-style: none;
}

.notes-list li {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .6rem;
  transition: border-color .2s, box-shadow .2s;
  overflow: hidden;
}

.notes-list li:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.notes-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  text-decoration: none;
  color: var(--text);
  gap: 1rem;
}

.note-title {
  font-weight: 600;
  font-size: .95rem;
}

.note-date {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: .95rem;
}

/* ---- SEO Content & FAQ ---- */
.seo-content {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  margin-top: 2.5rem;
  box-shadow: var(--shadow);
}

.seo-content h2 {
  font-size: 1.3rem;
  margin-bottom: .8rem;
  color: var(--text);
}

.seo-content h3 {
  font-size: 1.05rem;
  margin: 1.4rem 0 .5rem;
  color: var(--primary-d);
}

.seo-content p {
  margin-bottom: .8rem;
  color: #374151;
  font-size: .97rem;
  line-height: 1.75;
}

.faq {
  margin-top: 1.5rem;
}

.faq-item {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  font-size: .97rem;
}

.faq-q::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--primary);
  transition: transform .3s;
  flex-shrink: 0;
}

.faq-q.open::after {
  transform: rotate(45deg);
}

.faq-a {
  display: none;
  color: #374151;
  font-size: .93rem;
  line-height: 1.7;
  margin-top: .5rem;
}

/* ---- Footer ---- */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: 3rem;
  border-radius: 14px 14px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
  padding: 3rem 2.5rem 2rem;
}

.footer-heading {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: #f1f5f9;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: .55rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: .88rem;
  transition: color .2s;
}

.footer-links a:hover {
  color: #f1f5f9;
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: 1rem;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  transition: color .2s, transform .15s;
}

.footer-social-btn:hover {
  color: #f1f5f9;
  transform: translateX(3px);
}

.footer-social-btn--fb:hover {
  color: #60a5fa;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 1.2rem 2.5rem;
  text-align: center;
  font-size: .78rem;
  color: #475569;
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
    padding: 2rem 1.2rem 1.5rem;
  }

  .footer-bottom {
    padding: 1rem 1.2rem;
  }
}


/* ---- Meta note info ---- */
.meta {
  font-size: .83rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

/* ---- Note view content ---- */
.note-content {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  font-size: .97rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- AdSense placeholder ---- */
.ad-slot {
  background: #f1f5f9;
  border: 1.5px dashed #cbd5e1;
  border-radius: var(--radius);
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: .83rem;
  margin: 1.5rem 0;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .editor-card {
    padding: 1.1rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Char counter ---- */
.char-counter {
  font-size: .78rem;
  color: var(--muted);
  text-align: right;
  margin-top: .2rem;
}

/* ---- Social links ---- */
.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: .8rem;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid var(--border);
  color: var(--text);
  background: var(--bg);
  transition: background .2s, border-color .2s, color .2s, transform .1s;
}

.social-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ---- Animations ---- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.editor-card,
.seo-content,
.notes-list li {
  animation: fadeIn .35s ease both;
}

/* ---- Auth Wrap ---- */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem;
  flex: 1;
}

.auth-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(59,130,246,.10);
  animation: fadeIn .35s ease both;
}

.auth-icon {
  font-size: 2.8rem;
  text-align: center;
  margin-bottom: .6rem;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: .3rem;
}

.auth-sub {
  color: var(--muted);
  font-size: .92rem;
  text-align: center;
  margin-bottom: 1.6rem;
}

.auth-form .form-group {
  margin-bottom: 1.1rem;
}

/* ---- Password toggle wrapper ---- */
.input-pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-pw-wrap input {
  flex: 1;
  padding-right: 2.8rem;
}

.toggle-pw {
  position: absolute;
  right: .6rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: .2rem;
  color: var(--muted);
  line-height: 1;
  transition: opacity .2s;
}

.toggle-pw:hover {
  opacity: .7;
}

/* ---- email + password input ---- */
input[type="email"],
input[type="password"] {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: #f8fafc;
  transition: border-color .2s, box-shadow .2s;
}

input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
  background: #fff;
}

/* ---- Full-width button ---- */
.btn-full {
  width: 100%;
  justify-content: center;
  padding: .7rem;
  font-size: 1rem;
  margin-top: .4rem;
  border-radius: 10px;
}

.auth-switch {
  text-align: center;
  margin-top: 1.3rem;
  font-size: .9rem;
  color: var(--muted);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ---- Header user badge & auth nav buttons ---- */
.user-badge {
  font-size: .88rem;
  font-weight: 600;
  color: var(--primary);
  background: #eff6ff;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: .28rem .85rem;
  margin-left: 1rem;
  white-space: nowrap;
}

.btn-nav-blog {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  text-decoration: none;
  margin-left: 1rem;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-nav-blog:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(245, 158, 11, 0.4);
  color: #fff;
}

.btn-nav-login,
.btn-nav-register,
.btn-nav-logout {
  display: inline-block;
  font-size: .85rem;
  font-weight: 600;
  border-radius: 8px;
  padding: .32rem .9rem;
  text-decoration: none;
  margin-left: .6rem;
  transition: background .2s, color .2s, border-color .2s;
}

.btn-nav-login {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

.btn-nav-login:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-nav-register {
  background: var(--primary);
  color: #fff;
  border: 1.5px solid var(--primary);
}

.btn-nav-register:hover {
  background: var(--primary-d);
  border-color: var(--primary-d);
}

.btn-nav-logout {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid #fecaca;
}

.btn-nav-logout:hover {
  background: #fee2e2;
  border-color: var(--danger);
}

@media (max-width: 600px) {
  .auth-card {
    padding: 1.6rem 1.1rem 1.4rem;
  }

  .user-badge {
    display: none;
  }
}