/* =============================================================
   PakSpeaks — style.css
   Core variables, reset, layout, utilities
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400&family=Inter:wght@300;400;500;600;700;800&display=swap');

/* -------------------------------------------------------------
   CSS Custom Properties
   ------------------------------------------------------------- */
:root {
  /* Background */
  --bg-primary:   #080E1A;
  --bg-card:      #0F1829;
  --bg-elevated:  #162035;

  /* Borders */
  --border-color: #1a2540;

  /* Brand */
  --green-primary: #00A86B;
  --green-hover:   #00c47e;
  --gold:          #F59E0B;

  /* Text */
  --text-primary:   #FFFFFF;
  --text-secondary: #94A3B8;
  --text-muted:     #4B6080;

  /* Category colours */
  --cat-breaking:    #EF4444;
  --cat-technology:  #3B82F6;
  --cat-showbiz:     #EC4899;
  --cat-business:    #14B8A6;
  --cat-sports:      #8B5CF6;
  --cat-startups:    #00A86B;

  /* Typography */
  --font-body:    'Inter', system-ui, sans-serif;
  --font-heading: 'Playfair Display', Georgia, serif;

  /* Layout */
  --navbar-height:   64px;
  --ticker-height:   40px;
  --radius:          12px;
  --radius-sm:       8px;
  --container-max:   1280px;
}

/* -------------------------------------------------------------
   Light Mode Overrides
   ------------------------------------------------------------- */
body.light-mode {
  --bg-primary:    #F1F5F9;
  --bg-card:       #FFFFFF;
  --bg-elevated:   #E8EEF6;
  --border-color:  #CBD5E1;
  --text-primary:  #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;
}

/* -------------------------------------------------------------
   Reset
   ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  padding-top: calc(var(--navbar-height) + var(--ticker-height));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

ul,
ol {
  list-style: none;
}

/* -------------------------------------------------------------
   Scrollbar
   ------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* -------------------------------------------------------------
   Selection
   ------------------------------------------------------------- */
::selection {
  background: rgba(0, 168, 107, 0.3);
  color: var(--text-primary);
}

/* -------------------------------------------------------------
   Placeholder
   ------------------------------------------------------------- */
::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* -------------------------------------------------------------
   Layout
   ------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding: 60px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
}

/* -------------------------------------------------------------
   Section Titles
   ------------------------------------------------------------- */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  position: relative;
  padding-left: 16px;
  color: var(--text-primary);
  line-height: 1.2;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 2px;
}

.section-title.featured::before    { background: var(--green-primary); }
.section-title.technology::before  { background: var(--cat-technology); }
.section-title.showbiz::before     { background: var(--cat-showbiz); }
.section-title.sports::before      { background: var(--cat-sports); }
.section-title.trending::before    { background: var(--gold); }
.section-title.business::before    { background: var(--cat-business); }
.section-title.startups::before    { background: var(--cat-startups); }

/* -------------------------------------------------------------
   Grids
   ------------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

/* -------------------------------------------------------------
   Divider
   ------------------------------------------------------------- */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 0 24px;
}

/* -------------------------------------------------------------
   Buttons
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  outline: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.35);
}

.btn-primary {
  background: var(--green-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--green-hover);
  filter: brightness(1.08);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  border-color: var(--green-primary);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: #ffffff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn-danger {
  background: #EF4444;
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

/* -------------------------------------------------------------
   Badges
   ------------------------------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.6;
}

.badge-breaking    { background: rgba(239, 68,  68,  0.15); color: #EF4444; }
.badge-technology  { background: rgba(59,  130, 246, 0.15); color: #3B82F6; }
.badge-showbiz     { background: rgba(236, 72,  153, 0.15); color: #EC4899; }
.badge-business    { background: rgba(20,  184, 166, 0.15); color: #14B8A6; }
.badge-sports      { background: rgba(139, 92,  246, 0.15); color: #8B5CF6; }
.badge-startups    { background: rgba(0,   168, 107, 0.15); color: #00A86B; }
.badge-default     { background: rgba(148, 163, 184, 0.15); color: #94A3B8; }

/* -------------------------------------------------------------
   Forms
   ------------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  appearance: none;
}

.form-input:focus {
  border-color: var(--green-primary);
  box-shadow: 0 0 0 3px rgba(0, 168, 107, 0.1);
}

.form-error {
  color: #EF4444;
  font-size: 0.8rem;
  margin-top: 6px;
  display: block;
}

/* -------------------------------------------------------------
   Fade-in Animation
   ------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------------------
   Skeleton Loading
   ------------------------------------------------------------- */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-elevated) 25%,
    var(--border-color) 50%,
    var(--bg-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

.skeleton-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.skeleton-image {
  height: 200px;
}

.skeleton-content {
  padding: 16px;
}

.skeleton-badge {
  height: 20px;
  width: 70px;
  margin-bottom: 10px;
}

.skeleton-title {
  height: 22px;
  width: 90%;
  margin-bottom: 8px;
}

.skeleton-title-2 {
  height: 22px;
  width: 70%;
}

.skeleton-text {
  height: 14px;
  width: 85%;
  margin: 12px 0 6px;
}

.skeleton-text-2 {
  height: 14px;
  width: 65%;
}

.skeleton-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-meta-text {
  height: 14px;
  width: 120px;
}

/* -------------------------------------------------------------
   Toast Notifications
   ------------------------------------------------------------- */
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes slideOutRight {
  to { transform: translateX(110%); opacity: 0; }
}

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: slideInRight 0.3s ease;
  pointer-events: auto;
}

.toast.success { border-left: 3px solid var(--green-primary); }
.toast.error   { border-left: 3px solid #EF4444; }
.toast.info    { border-left: 3px solid #3B82F6; }
.toast.warning { border-left: 3px solid var(--gold); }

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toast.success .toast-icon { background: rgba(0,   168, 107, 0.2); color: var(--green-primary); }
.toast.error   .toast-icon { background: rgba(239, 68,  68,  0.2); color: #EF4444; }
.toast.info    .toast-icon { background: rgba(59,  130, 246, 0.2); color: #3B82F6; }
.toast.warning .toast-icon { background: rgba(245, 158, 11,  0.2); color: var(--gold); }

.toast-message {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
}

.toast.hiding {
  animation: slideOutRight 0.3s ease forwards;
}
