/* =================================================================
   GITHUB CONTRIBUTION WIDGET STYLES
   ================================================================= */

/* Main Widget Container */
.gh-widget-wrapper {
  max-width: 1000px;
  margin: 0 auto;
  padding: 30px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.05)
  );
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  font-family: "Roboto", sans-serif;
  color: #fff;
}

/* Header Styling */
.gh-widget-header {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
}

.gh-widget-header-icon {
  margin-right: 12px;
  color: #bac964;
}

.gh-widget-header h2 {
  font-size: 1.5rem;
  font-weight: 300;
  margin: 0;
  color: #fff;
}

/* Calendar container */
.gh-widget-calendar-container {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

/* Stats cards container */
.gh-widget-stats-container {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-top: 25px;
}

/* Individual stat card */
.gh-widget-stat-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 20px;
  position: relative;
  text-align: center;
  overflow: hidden;
  backdrop-filter: blur(5px);
}

/* Color accent on top of cards */
.gh-widget-stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.gh-widget-yearly-card::before {
  background: linear-gradient(90deg, #bac964, #b2c251);
}

.gh-widget-longest-card::before {
  background: linear-gradient(90deg, #8490ff, #62bdfc);
}

.gh-widget-current-card::before {
  background: linear-gradient(90deg, #ff8a80, #ff5722);
}

.gh-widget-stat-card h3 {
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 5px;
  margin-bottom: 15px;
}

.gh-widget-stat-value {
  font-size: 2.5rem;
  font-weight: 300;
  color: #fff;
  margin-bottom: 5px;
}

.gh-widget-stat-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

/* GitHub Calendar overrides */
.gh-widget-wrapper .calendar {
  width: 100%;
  border: none !important;
}

.gh-widget-wrapper .calendar .js-calendar-graph-svg {
  max-width: 100% !important;
}

/* Calendar text colors */
.gh-widget-wrapper .calendar text.month,
.gh-widget-wrapper .calendar text.wday {
  fill: rgba(255, 255, 255, 0.8);
  font-size: 10px;
}

/* Hide default GitHub calendar stats */
.gh-widget-wrapper .contrib-column,
.gh-widget-wrapper .contrib-footer {
  display: none !important;
}

/* Legend styling */
.gh-widget-wrapper .contrib-legend {
  text-align: right;
  padding: 5px 0;
  color: rgba(255, 255, 255, 0.7);
}

/* Loading state */
.gh-widget-loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.gh-widget-loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: #bac964;
  animation: gh-widget-spin 1s ease-in-out infinite;
  margin-bottom: 20px;
}

@keyframes gh-widget-spin {
  to {
    transform: rotate(360deg);
  }
}

.gh-widget-loading-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* User info section */
.gh-widget-user-info {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Make the whole user info row clickable without default link styling */
.gh-widget-user-info {
  color: inherit;
  text-decoration: none;
}
.gh-widget-user-info:hover {
  text-decoration: none;
  filter: brightness(1.03);
}

.gh-widget-user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  margin-right: 15px;
  background-color: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.gh-widget-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gh-widget-user-details {
  flex: 1;
}

.gh-widget-user-name {
  font-size: 1.2rem;
  font-weight: 300;
  margin: 0;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}

.gh-widget-user-name a {
  color: #fff;
  text-decoration: none;
}

.gh-widget-user-name a:hover {
  text-decoration: underline;
  color: #bac964;
}

.gh-widget-user-handle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.gh-widget-github-icon {
  margin-left: 8px;
  color: rgba(255, 255, 255, 0.6);
}

/* Responsiveness */
@media screen and (max-width: 768px) {
  .gh-widget-wrapper {
    margin: 0 15px;
    padding: 20px;
  }

  .gh-widget-stats-container {
    flex-direction: column;
  }

  .gh-widget-stat-card {
    margin-bottom: 15px;
  }

  .gh-widget-header h2 {
    font-size: 1.3rem;
  }

  .gh-widget-stat-value {
    font-size: 2rem;
  }
}

@media screen and (max-width: 480px) {
  .gh-widget-wrapper {
    margin: 0 10px;
    padding: 15px;
  }

  .gh-widget-calendar-container {
    padding: 15px;
  }

  .gh-widget-user-avatar {
    width: 35px;
    height: 35px;
  }

  .gh-widget-user-name {
    font-size: 1rem;
  }

  .gh-widget-stat-value {
    font-size: 1.8rem;
  }

  .gh-widget-stat-card {
    padding: 15px;
  }
}

/* Enhanced GitHub Calendar styling for better visibility */
.gh-widget-wrapper .calendar .contrib-details {
  color: rgba(255, 255, 255, 0.8) !important;
}

.gh-widget-wrapper .calendar .contrib-footer {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* Improve calendar squares visibility */
.gh-widget-wrapper .calendar .js-calendar-graph-svg {
  border-radius: 3px;
}

.gh-widget-wrapper .calendar .js-calendar-graph-svg rect[fill="#ebedf0"] {
  fill: rgba(255, 255, 255, 0.1) !important;
}

.gh-widget-wrapper .calendar .js-calendar-graph-svg rect[fill="#9be9a8"] {
  fill: #bac964 !important;
}

.gh-widget-wrapper .calendar .js-calendar-graph-svg rect[fill="#40c463"] {
  fill: #b2c251 !important;
}

.gh-widget-wrapper .calendar .js-calendar-graph-svg rect[fill="#30a14e"] {
  fill: #8490ff !important;
}

.gh-widget-wrapper .calendar .js-calendar-graph-svg rect[fill="#216e39"] {
  fill: #62bdfc !important;
}
