/* ============================================= */
/* 1. Global Styles & Variables                  */
/* ============================================= */

/* Defines the color palette and base variables for the entire application. */
:root {
  --background: #f7f8fa;
  --card-bg: #ffffff;
  --text-primary: #333333;
  --text-secondary: #555555;
  --blue: #004b8d;
  --green: #01e8a8;
  --border-color: #e5e7eb;
}

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

/* Base styles applied to the entire page. */
body {
  font-family: "Montserrat", sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
}

/* ============================================= */
/* 2. Card Component                             */
/* ============================================= */

/* Styles the basic card element that holds the links. */
.card {
  background-color: var(--card-bg);
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease-in-out;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03),
    0 1px 2px -1px rgba(0, 0, 0, 0.03);
}

/* Adds a hover effect to lift the card and increase its shadow. */
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.07),
    0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

/* Styles the title within each card. */
.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--green);
  display: inline-block;
}

/* Styles the list that contains the link items. */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ============================================= */
/* 3. Link Item & Icons                          */
/* ============================================= */

/* Styles each individual link inside a card. */
.link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.5rem;
  border-radius: 0.375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  background-color: transparent;
}

/* Changes the link color on hover. */
.link-item:hover {
  color: var(--blue);
  background-color: #eff6ff; /* A very light blue */
}

/* Allows the link text to fill available space. */
.link-text {
  flex-grow: 1;
}

/* Base style for the icons next to the links. */
.link-icon {
  width: 18px;
  height: 18px;
  background-color: currentColor; /* Icon color matches the text color. */
  transition: background-color 0.2s;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}

/* Uses an SVG shape as a mask to create the download icon. */
.download-icon {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" /></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" /></svg>');
}

/* Uses an SVG shape as a mask to create the external link icon. */
.external-icon {
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-4.5 0V6.375c0-.621.504-1.125 1.125-1.125h4.125c.621 0 1.125.504 1.125 1.125V10.5m-7.5-4.5h4.5m-4.5 4.5l7.5-7.5" /></svg>');
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-4.5 0V6.375c0-.621.504-1.125 1.125-1.125h4.125c.621 0 1.125.504 1.125 1.125V10.5m-7.5-4.5h4.5m-4.5 4.5l7.5-7.5" /></svg>');
}

/* ============================================= */
/* 4. UI Controls & Footer                       */
/* ============================================= */

/* Style for the OS button when it is selected. */
.os-btn.selected {
  background-color: var(--blue);
  color: white;
  border-color: var(--blue);
}

/* Styles the page footer. */
.footer {
  padding: 1rem;
  text-align: center;
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ============================================= */
/* 5. Animations & Transitions                   */
/* ============================================= */

/* Defines the fade-in animation sequence. */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px); /* Subtle slide-up effect */
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Defines the fade-out animation sequence. */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-15px); /* Subtle slide-down effect */
  }
}

/* Class to apply the fade-in animation. */
.fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Class to apply the fade-out animation. */
.fade-out {
  animation: fadeOut 0.4s ease-in forwards;
}

/* ============================================= */
/* 6. Custom Scrollbar                           */
/* ============================================= */

/* Styles the scrollbar for WebKit-based browsers (Chrome, Safari, Edge). */
::-webkit-scrollbar {
  width: 8px;
}

/* Styles the track (the background) of the scrollbar. */
::-webkit-scrollbar-track {
  background: transparent;
}

/* Styles the thumb (the draggable part) of the scrollbar. */
::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 10px;
  border: 2px solid var(--background);
}

/* Changes the thumb color on hover. */
::-webkit-scrollbar-thumb:hover {
  background-color: var(--blue);
}

/* Provides similar scrollbar styling for Firefox. */
* {
  scrollbar-width: thin;
  scrollbar-color: #555 var(--background);
}
