/* Reset and Base Styles */
/* Hide add buttons when lapsed */
.schedule-item.is-lapsed .actions,
.schedule-item.is-lapsed .schedule-actions { display: none !important; }
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Section Frame (asas) */
.section-frame {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  position: relative;
}

/* Jalur accent di bahagian atas section untuk membezakan setiap section */
.section-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  background: var(--frame-accent, #667eea);
  opacity: 0.95;
}

/* Variasi warna accent */
.frame-indigo { --frame-accent: #667eea; }
.frame-blue   { --frame-accent: #2563eb; }
.frame-green  { --frame-accent: #10b981; }
.frame-rose   { --frame-accent: #f43f5e; }
.frame-slate  { --frame-accent: #334155; }

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-left {
    flex: 1;
    text-align: left;
}

.header-right {
    flex-shrink: 0;
}

/* Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem;
}

.site-logo {
    height: 50px;
    width: auto;
    max-width: 200px;
    min-width: 120px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.site-logo:hover {
    transform: scale(1.05) translateZ(0);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Remove analytics link styles since it's no longer needed */

.main-title {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.main-title i {
    margin-right: 1rem;
    color: #ffd700;
}

.subtitle {
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
    opacity: 0.9;
    font-weight: 400;
}

.description {
    font-size: 1rem;
    margin: 0;
    opacity: 0.8;
    font-weight: 300;
}

@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .header-left {
        text-align: center;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .logo-container {
        margin-top: 1rem;
        justify-content: center;
        padding: 0.25rem;
    }
    
    .site-logo {
        height: 45px;
        max-width: 180px;
        min-width: 100px;
    }
}

/* Quick Actions */
.quick-actions-top {
    text-align: center;
    margin: 30px 0;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Bottom Actions */
.bottom-actions {
    text-align: center;
    margin: 40px 0 20px 0;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.bottom-action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.bottom-action-buttons .btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.bottom-action-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Calendar Credit Styling */
.calendar-credit {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.calendar-credit p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.credit-link {
    color: #00b4a6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.credit-link:hover {
    color: #008a7f;
    text-decoration: underline;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Version Info */
.version-info {
    text-align: center;
    margin: 20px 0 10px 0;
    padding: 10px;
}

.version-info span {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    color: #0b1b2b;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 160px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 87, 108, 0.4);
}

.btn-tertiary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-tertiary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(79, 172, 254, 0.4);
}

/* Filter Section */
.filter-section {
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: 0 12px 28px rgba(18, 38, 63, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.filter-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

.filter-group, .search-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: #1a202c;
    font-size: 0.95rem;
}

.filter-group select, .search-group input {
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.25s ease;
    background: #ffffff;
}

.filter-group select:focus, .search-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-group {
    position: relative;
}

.search-group i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
}

/* Schedule Section */
.schedule-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 25px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.section-title i {
    color: #ffd700;
}

/* Compact schedule card layout */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
}

.schedule-item.compact {
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Status stamp */
.status-stamp {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  display: inline-block;
}

.status-stamp.stamp-in-progress {
  background: #2563eb; /* blue */
}

.status-stamp.stamp-lapsed {
  background: #6b7280; /* gray */
}

/* Lapsed stamp overlay */
.schedule-item.is-lapsed { position: relative; overflow: hidden; }
.schedule-item .lapsed-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: 12px;
  box-sizing: border-box;
}
.schedule-item .lapsed-overlay::before {
  content: "";
  width: clamp(120px, 58%, 260px);
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: 1/1;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.2;
  transform: rotate(-10deg);
  /* Inline SVG red 'LAPSED' stamp */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 500'><defs><style>.r{fill:none;stroke:%23b91c1c;stroke-width:32;stroke-linecap:round;stroke-linejoin:round}.t{font:700 120px sans-serif;fill:%23b91c1c;letter-spacing:6px}</style></defs><circle class='r' cx='250' cy='250' r='200'/><circle class='r' cx='250' cy='250' r='230' opacity='0.35'/><g transform='rotate(-10 250 250)'><text class='t' x='70' y='285'>LAPSED</text></g></svg>");
}

@media (max-width: 768px) {
  .schedule-item .lapsed-overlay::before { width: clamp(110px, 56%, 220px); opacity: 0.22; }
}

@media (max-width: 480px) {
  .schedule-item .lapsed-overlay::before { width: clamp(96px, 54%, 200px); opacity: 0.24; }
}

.schedule-item.compact .compact-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
}

.schedule-item.compact .subject-name {
  font-weight: 600;
  color: #1f2937;
}

.schedule-item.compact .subject-code {
  margin-left: 6px;
  font-size: 0.85rem;
  color: #6b7280;
}

/* Countdown visuals */
.countdown-item {
  font-weight: 600;
  color: #2563eb;
}

.countdown-item.blink-red {
  color: #ef4444; /* red */
  animation: blink-red 1s linear infinite;
}

@keyframes blink-red {
  0% { opacity: 1; }
  50% { opacity: 0.25; }
  100% { opacity: 1; }
}

.schedule-item.compact .datetime .date,
.schedule-item.compact .datetime .day,
.schedule-item.compact .datetime .time {
  display: inline-block;
  margin-right: 6px;
  font-size: 0.9rem;
  color: #374151;
}

.schedule-item.compact .actions .btn.quick-add {
  padding: 6px 10px;
  font-size: 0.85rem;
}

/* Compact card actions layout and button sizing */
.schedule-item.compact .actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.schedule-item.compact .actions .btn {
  min-width: auto; /* override global min-width to prevent overflow */
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.schedule-item.compact .actions .btn i {
  font-size: 0.9rem;
}

/* Make primary add button compact-sized within cards */
.schedule-item.compact .actions .btn.btn-primary,
.schedule-item.compact .actions .btn.add-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* Ensure actions column has reasonable minimum space */
.schedule-item.compact .compact-row {
  /* Ensure actions column has enough room for two buttons on desktop */
  grid-template-columns: 1.4fr 1fr 1.2fr minmax(240px, 1fr);
}

/* Keep action buttons contained within the card and wrap gracefully */
.schedule-item.compact .actions {
  max-width: 100%;
}
.schedule-item.compact .actions .btn {
  /* Allow buttons to shrink/grow and wrap without overflowing */
  flex: 1 1 120px;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .schedule-item.compact .compact-row {
    /* Slightly wider actions column on large screens */
    grid-template-columns: 1.4fr 1fr 1.1fr minmax(280px, 1fr);
  }
}

@media (max-width: 640px) {
  .schedule-item.compact .compact-row {
    grid-template-columns: 1fr;
  }
  .schedule-item.compact .actions {
    margin-top: 6px;
    justify-content: flex-start;
  }
}

/* Prevent scrolling when modal open */
body.modal-open {
  overflow: hidden;
}
.schedule-item {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 5px solid #667eea;
}

.schedule-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.schedule-item.hidden {
    display: none;
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.subject-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 5px;
}

.subject-code {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

.schedule-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.calendar-btn {
    background: #667eea;
    color: white;
}

.calendar-btn:hover {
    background: #5a67d8;
    transform: scale(1.05);
}

.reminder-btn {
    background: #f093fb;
    color: white;
}

.reminder-btn:hover {
    background: #e879f9;
    transform: scale(1.05);
}

.schedule-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.detail-item {
    text-align: center;
    padding: 12px;
    background: #f7fafc;
    border-radius: 10px;
}

.detail-label {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 500;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.date-value {
    color: #667eea;
}

.time-value {
    color: #f093fb;
}

.duration-value {
    color: #4facfe;
}

/* Notes Section */
.notes-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.notes-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notes-title i {
    color: #f093fb;
}

.notes-content ul {
    list-style: none;
    padding: 0;
}

.notes-content li {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    padding-left: 25px;
}

.notes-content li:last-child {
    border-bottom: none;
}

.notes-content li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover {
    color: #000;
}

.modal h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.modal-body p {
    margin-bottom: 10px;
    color: #4a5568;
    font-weight: 500;
}

.calendar-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.reminder-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.reminder-section h4 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.reminder-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

.footer p {
    margin: 8px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.email-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4facfe;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(79, 172, 254, 0.1);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.email-link:hover {
    background: rgba(79, 172, 254, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

/* Quick Share Buttons for Individual Subjects */
.quick-share-buttons {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.share-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.share-label::before {
    content: "📅";
    margin-right: 8px;
}

.share-buttons-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.quick-share-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 80px;
    justify-content: center;
}

.quick-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.google-btn {
    background: linear-gradient(135deg, #4285f4 0%, #34a853 100%);
    color: white;
}

.google-btn:hover {
    background: linear-gradient(135deg, #3367d6 0%, #2d8f47 100%);
}

.outlook-btn {
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
    color: white;
}

.outlook-btn:hover {
    background: linear-gradient(135deg, #106ebe 0%, #005a9e 100%);
}

.ics-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.ics-btn:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
}

/* Site Share Button */
.btn-share {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    border: none;
}

.btn-share:hover {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

/* Site Share Modal Styles */
.share-description {
    color: #6c757d;
    margin-bottom: 20px;
    text-align: center;
    font-style: italic;
}

.share-url-section {
    margin-bottom: 25px;
}

.share-url-section label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.url-copy-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.url-copy-container input {
    flex: 1;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background-color: #f8f9fa;
}

.btn-copy {
    padding: 10px 15px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
}

.btn-copy:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-1px);
}

.social-share-options h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 1.1rem;
}

.social-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 0.9rem;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.facebook-btn {
    background: linear-gradient(135deg, #1877f2 0%, #42a5f5 100%);
    color: white;
}

.facebook-btn:hover {
    background: linear-gradient(135deg, #166fe5 0%, #1976d2 100%);
}

.twitter-btn {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    color: white;
}

.twitter-btn:hover {
    background: linear-gradient(135deg, #0d8bd9 0%, #0c7cd5 100%);
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
}

.whatsapp-btn:hover {
    background: linear-gradient(135deg, #128c7e 0%, #075e54 100%);
}

.telegram-btn {
    background: linear-gradient(135deg, #0088cc 0%, #005f8a 100%);
    color: white;
}

.telegram-btn:hover {
    background: linear-gradient(135deg, #005f8a 0%, #004d6b 100%);
}

.email-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.email-btn:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
}

/* Responsive Design for Share Buttons */
@media (max-width: 768px) {
    .share-buttons-row {
        justify-content: center;
    }
    
    .quick-share-btn {
        min-width: 70px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .social-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .url-copy-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .url-copy-container input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quick-share-btn {
        min-width: 60px;
        padding: 5px 8px;
        font-size: 0.75rem;
        gap: 4px;
    }
    
    .social-buttons {
        grid-template-columns: 1fr;
    }
    
    .site-logo {
        height: 40px;
        max-width: 150px;
        min-width: 80px;
    }
    
    .logo-container {
        padding: 0.125rem;
    }
}
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .main-title i {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group, .search-group {
        min-width: auto;
    }
    
    .schedule-grid {
        grid-template-columns: 1fr;
    }
    
    .schedule-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .schedule-actions {
        justify-content: center;
    }
    
    .section-title {
        font-size: 1.6rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
        padding: 25px;
    }
    
    .calendar-options {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 25px 20px;
    }
    
    .main-title {
        font-size: 1.8rem;
    }
    
    .schedule-item {
        padding: 20px;
    }
    
    .schedule-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .notes-section {
        padding: 20px;
    }
}

/* Animation for loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.schedule-item {
    animation: fadeInUp 0.6s ease forwards;
}

.schedule-item:nth-child(even) {
    animation-delay: 0.1s;
}

.schedule-columns { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.schedule-column { display: flex; flex-direction: column; gap: 12px; }
.schedule-column .schedule-item { margin-bottom: 0; }
.column-header { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: #334155; }
@media (min-width: 768px) { .schedule-columns { grid-template-columns: 1fr 1fr; } }

.schedule-item:nth-child(odd) {
    animation-delay: 0.2s;
}

/* Analytics Dashboard Styles */
.analytics-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 3rem 0;
    margin: 3rem 0;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.analytics-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.analytics-header {
    text-align: center;
    margin-bottom: 3rem;
}

.analytics-title {
    color: #1a202c;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.analytics-title i {
    color: #667eea;
}

.analytics-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    margin: 0;
}

/* Main Stats Grid */
.analytics-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.analytics-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.analytics-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.analytics-card.primary {
    border-left: 4px solid #667eea;
}

.analytics-card.secondary {
    border-left: 4px solid #48bb78;
}

.analytics-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.analytics-card.primary .analytics-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.analytics-card.secondary .analytics-icon {
    background: linear-gradient(135deg, #48bb78, #38a169);
}

.analytics-content {
    flex: 1;
}

.analytics-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.analytics-label {
    color: #4a5568;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.analytics-trend {
    color: #48bb78;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Table Styles */
.analytics-table-container {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
}

.analytics-section-title {
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analytics-section-title i {
    color: #667eea;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
    display: table;
}

.analytics-table-header {
    display: table-row;
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    border-radius: 8px;
}

.analytics-table-header .table-cell {
    font-weight: 700;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.analytics-table-row {
    display: table-row;
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.analytics-table-row:hover {
    background-color: #f8fafc;
}

.analytics-table-row:last-child {
    border-bottom: none;
}

.table-cell {
    display: table-cell;
    padding: 1rem;
    vertical-align: middle;
    text-align: left;
}

.table-cell:first-child {
    font-weight: 600;
    color: #2d3748;
}

.table-cell i {
    margin-right: 0.5rem;
    color: #667eea;
    width: 16px;
}

.metric-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
}

.percentage {
    font-weight: 600;
    color: #48bb78;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #c6f6d5;
    color: #22543d;
}

/* Action Buttons */
.analytics-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.analytics-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.export-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.refresh-btn {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.3);
}

.reset-btn {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 101, 101, 0.3);
}

/* Responsive Design for Analytics */
@media (max-width: 768px) {
    .analytics-container {
        padding: 0 1rem;
    }
    
    .analytics-main-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .analytics-card {
        padding: 1.5rem;
    }
    
    .analytics-number {
        font-size: 2rem;
    }
    
    .analytics-table-container {
        padding: 1.5rem;
        overflow-x: auto;
    }
    
    .analytics-table {
        min-width: 600px;
    }
    
    .analytics-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .analytics-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .analytics-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .analytics-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .analytics-number {
        font-size: 1.25rem;
    }
    
    .analytics-label {
        font-size: 0.8rem;
    }
    
    .table-cell {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Modernize multi-select to match jadual card style */
.filter-group select[multiple] {
  background: #ffffff;
  color: #0b1b2b;
  border: 1px solid #e0e6ed;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(11, 27, 43, 0.08);
  padding: 12px;
}

.filter-group select[multiple] option {
  color: #0b1b2b;
  padding: 8px 10px;
}

.filter-group select[multiple] option:checked {
  background-color: #12d4c9;
  color: #0b1b2b;
}
.filter-hint {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}
.version-info span {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    color: #0b1b2b;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.25);
}
.version-info p {
    margin: 0;
    font-size: 12px;
    color: #666;
}
.version-info {
    text-align: center;
    margin: 20px 0 10px 0;
    padding: 10px;
}

/* Mobile-friendly checkbox filter fallback */
.mobile-checkboxes {
  display: none;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #e0e6ed;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(11, 27, 43, 0.08);
}

/* Improve checkbox chip styles */
.mobile-checkboxes .checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.95rem;
  color: #0b1b2b;
  background: #f8fafc;
  border: 1px solid #e0e6ed;
  border-radius: 9999px;
  cursor: pointer;
}
.mobile-checkboxes .checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.mobile-checkboxes .checkbox-item input[type="checkbox"]:checked + span {
  color: #0b1b2b;
  font-weight: 600;
}
.mobile-checkboxes .checkbox-item span {
  display: inline-block;
}

/* Show checkbox filter on small screens and tablets; keep multi-select on desktop */
@media (max-width: 1024px) {
  #subjectFilter { display: none; }
  .mobile-checkboxes {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 8px;
  }
  .filter-container { grid-template-columns: 1fr; }
}

/* Mobile narrow: single column for checkbox list */
@media (max-width: 640px) {
  .mobile-checkboxes { grid-template-columns: 1fr; }
}
/* About Section */
.about-section {
  margin: 24px 0;
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.about-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a202c;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.about-title i { color: #f5576c; }
.about-content p { margin: 6px 0; color: #2d3748; }

/* Footer Social Links */
.social-title { margin-top: 8px; color: #1a202c; }
.social-links { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.social-link { display: inline-flex; align-items: center; gap: 6px; color: #1f2937; text-decoration: none; font-weight: 500; }
.social-link i { font-size: 1rem; }
.social-link:hover { color: #667eea; }
}
/* RSS Section */
.rss-section {
  background: linear-gradient(135deg, #ecfeff 0%, #f0fdfa 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 12px 28px rgba(18, 38, 63, 0.06);
}
.rss-section .section-title {
  color: #0b1b2b;
}
.rss-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}
.rss-meta {
  text-align: center;
  font-size: 0.95rem;
  color: #0f172a; /* Lebih gelap untuk keterbacaan */
  font-weight: 600;
  margin-bottom: 12px;
}
.rss-meta .rss-sources {
  display: block;
  margin-top: 4px;
  color: #1f2937;
  font-weight: 500;
}
.rss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.rss-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-left: 5px solid #10b981;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rss-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
}
.rss-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.rss-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #d1fae5;
  color: #065f46;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.rss-source-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.75rem;
  line-height: 1rem;
  border-radius: 9999px;
  background: #e9eef7;
  color: #0d355c;
  font-weight: 700;
}

/* Warna rasmi bagi lencana sumber */
.rss-source-badge.source-kpm {
  background: #0d47a1; /* Biru KPM (anggaran) */
  color: #ffffff;
}
.rss-source-badge.source-metro {
  background: #e60012; /* Merah Harian Metro */
  color: #ffffff;
}
.rss-source-badge.source-sinar {
  background: #d71920; /* Merah Sinar Harian */
  color: #ffffff;
}
.rss-source-badge.source-bernama {
  background: #0076bf; /* Biru Bernama */
  color: #ffffff;
}
.rss-source-badge.source-awani {
  background: #f15a24; /* Jingga Astro Awani */
  color: #ffffff;
}
.rss-source-badge.source-unknown {
  background: #e9eef7; /* Lalai */
  color: #0d355c;
}
.rss-title {
  margin: 6px 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0b1b2b;
}
.rss-empty {
  text-align: center;
  color: #0f172a;
}
.rss-title a {
  color: inherit;
  text-decoration: none;
}
.rss-title a:hover {
  text-decoration: underline;
}
.rss-desc {
  font-size: 0.95rem;
  color: #1f2937;
}
.rss-card-actions {
  margin-top: 12px;
}
.rss-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #64748b;
}
.rss-card.skeleton {
  min-height: 140px;
  border-left-color: #94a3b8;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 640px) {
  .rss-grid { grid-template-columns: 1fr; }
}
