/* Import font from Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap");

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  /* Catppuccin Mocha Palette */
  --ctp-base: #1e1e2e;
  --ctp-mantle: #181825;
  --ctp-crust: #11111b;
  --ctp-text: #cdd6f4;
  --ctp-subtext0: #a6adc8;
  --ctp-surface0: #313244;
  --ctp-surface1: #45475a;
  --ctp-blue: #89b4fa;
  --ctp-mauve: #cba6f7;
  --ctp-red: #f38ba8;
  --ctp-green: #a6e3a1;
  --ctp-yellow: #f9e2af;
  --ctp-overlay0: #6c7086;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--ctp-base);
  background-size: cover;
  font-family: "Inter", sans-serif;
  color: var(--ctp-text);
  margin: 0;
  line-height: 1.6;
}

/* =========================================
   2. LAYOUT
   ========================================= */
.container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

/* =========================================
   3. WIDGETS (GENERAL)
   ========================================= */
.widget {
  background-color: rgba(30, 30, 46, 0.6); /* Slightly transparent */
  border: 1px solid var(--ctp-surface0);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px); /* Glassmorphism effect */
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--ctp-mauve);
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--ctp-surface0);
  padding-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.widget-header i {
  font-size: 1.2rem;
}

/* =========================================
   4. CLOCK & PROFILE WIDGET
   ========================================= */
#clock-widget {
  text-align: center;
  border: 1px solid var(--ctp-surface1);
  background: linear-gradient(
    145deg,
    var(--ctp-mantle) 0%,
    rgba(30, 30, 46, 0.8) 100%
  );
}

#clock {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--ctp-mauve);
  margin: 10px 0 20px 0;
  text-shadow: 0 0 20px rgba(203, 166, 247, 0.4);
  letter-spacing: 2px;
}

/* Profile Links */
.profile-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.profile-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  border-bottom: none !important;
  color: var(--ctp-subtext0);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--ctp-surface0);
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.profile-links a:visited,
.profile-links a:active,
.profile-links a:link {
  text-decoration: none !important;
}

.profile-links a:hover {
  transform: translateY(-3px);
  background-color: var(--ctp-surface0);
  border-color: var(--ctp-mauve);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  color: var(--ctp-text);
  border-bottom: none !important;
}

.profile-links a i {
  font-size: 1.1rem;
}

.profile-links a:hover .fa-github { color: var(--ctp-text); }
.profile-links a:hover .fa-instagram { color: var(--ctp-red); }
.profile-links a:hover .fa-linkedin { color: var(--ctp-blue); }

/* Bookmarks (Under Clock) */
.bookmarks {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 10px;
}

.bookmarks a {
  color: var(--ctp-subtext0);
  font-size: 1.6rem;
  text-decoration: none !important;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.bookmarks a:hover {
  transform: translateY(-3px) scale(1.1);
  opacity: 1;
}

.bookmarks a[href*="youtube"]:hover { color: var(--ctp-red); filter: drop-shadow(0 0 8px var(--ctp-red)); }
.bookmarks a[href*="calendar"]:hover { color: var(--ctp-blue); filter: drop-shadow(0 0 8px var(--ctp-blue)); }
.bookmarks a[href*="whatsapp"]:hover { color: var(--ctp-green); filter: drop-shadow(0 0 8px var(--ctp-green)); }


/* =========================================
   5. NEWS WIDGET
   ========================================= */
#news-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#news-container a {
  text-decoration: none !important;
  color: var(--ctp-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background-color: transparent;
  transition: all 0.2s ease;
}

#news-container a:hover {
  background-color: var(--ctp-surface0);
  border-color: var(--ctp-surface1);
  transform: translateX(5px);
  padding-left: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#news-container a span:first-child {
  font-weight: 500;
  line-height: 1.4;
  flex: 1; /* Allow title to take up available space */
}

.news-date {
  font-size: 0.75em;
  color: var(--ctp-overlay0);
  background-color: rgba(255, 255, 255, 0.05);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  font-family: "Inter", monospace;
  font-weight: 600;
}

/* Popup/Tooltip News */
#news-tooltip {
  display: none;
  position: fixed;
  z-index: 9999;
  background-color: var(--ctp-base);
  border: 1px solid var(--ctp-mauve);
  border-radius: 12px;
  width: 320px;
  padding: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  backdrop-filter: blur(5px);
}

#news-tooltip img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 10px;
  background-color: var(--ctp-surface0);
}

#tooltip-date {
  margin: 0 0 8px 0;
  font-size: 0.8rem;
  color: var(--ctp-subtext0);
  font-weight: 500;
}

#news-tooltip h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--ctp-text);
  line-height: 1.5;
  font-weight: 600;
}

/* Skeleton Loader Animation */
.skeleton-loader {
  height: 48px;
  width: 100%;
  background-color: var(--ctp-surface0);
  border-radius: 12px;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  opacity: 0.6;
}

.skeleton-loader::after {
  content: "";
  display: block;
  position: absolute;
  left: -150px;
  top: 0;
  height: 100%;
  width: 150px;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
  animation: load 1.5s cubic-bezier(0.4, 0.0, 0.2, 1) infinite;
}

@keyframes load {
  from { left: -150px; }
  to { left: 100%; }
}

/* =========================================
   6. GITHUB CHART WIDGET
   ========================================= */
.chart-link {
  display: block;
  width: 100%;
  overflow-x: auto;
  text-align: center;
  text-decoration: none !important;
  border-bottom: none !important;
}

.chart-link img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  /* Dark Mode Inversion Technique for ghchart */
  filter: invert(1); 
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0.9;
}

.chart-link:hover img {
  transform: translateY(-4px) scale(1.01);
  opacity: 1;
  filter: invert(1) drop-shadow(0 0 15px rgba(203, 166, 247, 0.3));
}