/* Global Variables */
:root {
  /* Ulbrich colors from website */
  --ulbrich-blue: #0095da;
  --ulbrich-dark-blue: #005f8c;
  --ulbrich-light-blue: #70c5ef;
  --ulbrich-gray: #58595b;
  --ulbrich-light-gray: #e6e7e8;
  
  /* Light mode */
  --background-color-light: #f5f8fa;
  --text-color-light: #333;
  --card-bg-light: #fff;
  --card-border-light: rgba(0, 0, 0, 0.08);
  --card-shadow-light: 0 4px 8px rgba(0, 0, 0, 0.05);
  --card-hover-shadow-light: 0 8px 16px rgba(0, 0, 0, 0.1);
  --icon-color-light: var(--ulbrich-blue);
  --section-title-color-light: var(--ulbrich-dark-blue);
  --header-bg-light: #f0f0f0;
  --header-bg-rgb-light: 240, 240, 240;
  
  /* Dark mode with navy blue */
  --background-color-dark: #0a1328; /* Dark navy blue */
  --text-color-dark: #f5f5f5;
  --card-bg-dark: #0f1d35; /* Slightly lighter navy blue for cards */
  --card-border-dark: rgba(255, 255, 255, 0.05);
  --card-shadow-dark: 0 4px 8px rgba(0, 0, 0, 0.3);
  --card-hover-shadow-dark: 0 8px 16px rgba(0, 0, 0, 0.4);
  --icon-color-dark: var(--ulbrich-light-blue);
  --section-title-color-dark: var(--ulbrich-light-blue);
  --header-bg-dark: #0a1220; /* Darker navy blue for header */
  --header-bg-rgb-dark: 10, 18, 32;
  
  /* Current theme (defaults to dark) */
  --background-color: var(--background-color-dark);
  --text-color: var(--text-color-dark);
  --card-bg: var(--card-bg-dark);
  --card-border: var(--card-border-dark);
  --card-shadow: var(--card-shadow-dark);
  --card-hover-shadow: var(--card-hover-shadow-dark);
  --icon-color: var(--icon-color-dark);
  --section-title-color: var(--section-title-color-dark);
  --header-bg: var(--header-bg-dark);
  --header-bg-rgb: var(--header-bg-rgb-dark);
}

/* Light Mode Class */
body.light-mode {
  --background-color: var(--background-color-light);
  --text-color: var(--text-color-light);
  --card-bg: var(--card-bg-light);
  --card-border: var(--card-border-light);
  --card-shadow: var(--card-shadow-light);
  --card-hover-shadow: var(--card-hover-shadow-light);
  --icon-color: var(--icon-color-light);
  --section-title-color: var(--section-title-color-light);
  --header-bg: var(--header-bg-light);
  --header-bg-rgb: var(--header-bg-rgb-light);
}

/* Dark Mode Class */
body.dark-mode {
  --background-color: var(--background-color-dark);
  --text-color: var(--text-color-dark);
  --card-bg: var(--card-bg-dark);
  --card-border: var(--card-border-dark);
  --card-shadow: var(--card-shadow-dark);
  --card-hover-shadow: var(--card-hover-shadow-dark);
  --icon-color: var(--icon-color-dark);
  --section-title-color: var(--section-title-color-dark);
  --header-bg: var(--header-bg-dark);
  --header-bg-rgb: var(--header-bg-rgb-dark);
}

/* Global Styles */
body {
  font-family: 'Source Sans Pro', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.5s ease-in-out, color 0.5s ease-in-out;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 50px; /* Add padding to account for fixed header */
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0.015em;
}

/* Background Canvas */
#background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Header Styles */
.logo-container {
  max-width: 220px;
  margin: 0 auto;
  margin-bottom: 10px;
}

.logo {
  width: 100%;
  height: auto;
  transition: filter 0.5s ease;
  color: var(--text-color);
}

body.dark-mode .logo {
  filter: brightness(0) invert(1); /* Make logo white in dark mode */
}

body.light-mode .logo {
  filter: brightness(0.2); /* Darken logo in light mode */
  color: var(--ulbrich-gray);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.section-title {
  color: var(--section-title-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
  padding-bottom: 0.5rem;
  font-size: 1.875rem;
  letter-spacing: -0.01em;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: var(--ulbrich-blue);
  transition: background-color 0.3s, width 0.3s;
}

.section-title:hover::after {
  width: 100%;
}

/* Card Styles */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.5s ease;
  height: 100%;
  overflow: hidden;
  opacity: 0; /* Start invisible for fade-in animation */
  transform: translateY(10px); /* Start slightly below final position */
}

.card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.card:hover, .card-focused {
  transform: translateY(-5px);
  box-shadow: var(--card-hover-shadow);
}

.card-link {
  color: var(--text-color);
  text-decoration: none;
  display: block;
  height: 100%;
  position: relative;
  z-index: 1;
}

.card-link:focus {
  outline: none;
}

.card-title {
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--ulbrich-blue);
  transition: color 0.5s ease;
  font-size: 1.125rem;
  line-height: 1.3;
}

.card-text {
  font-size: 0.95rem;
  color: var(--text-color);
  opacity: 0.9;
  line-height: 1.4;
}

/* System Card Specific */
.system-card {
  text-align: center;
  padding: 1rem 0.75rem;
}

.icon-container {
  width: 70px;
  height: 70px;
  margin: 0 auto;
  background-color: rgba(0, 149, 218, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.icon-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(0, 149, 218, 0.2) 0%, rgba(0, 149, 218, 0) 70%);
  transform: scale(0);
  transition: transform 0.5s ease-out;
}

.card:hover .icon-container::before {
  transform: scale(2);
}

.icon-container i {
  font-size: 1.75rem;
  color: var(--icon-color);
  transition: all 0.5s ease;
  position: relative;
  z-index: 2;
}

.card:hover .icon-container i {
  transform: scale(1.1);
}

body.light-mode .icon-container {
  background-color: rgba(0, 149, 218, 0.1);
}

body.dark-mode .icon-container {
  background-color: rgba(0, 149, 218, 0.2);
}

/* Website Card Specific */
.website-card .card-img-wrapper {
  height: 150px;
  overflow: hidden;
  position: relative;
}

.website-card .card-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.5s ease;
}

.website-card:hover .card-img {
  transform: scale(1.05);
}

.website-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg);
  text-align: center;
  padding: 1rem;
}

.website-placeholder i {
  font-size: 2.5rem;
  color: var(--icon-color);
  margin-bottom: 1rem;
}

.website-placeholder span {
  font-weight: 600;
  color: var(--text-color);
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
}

#theme-toggle-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: var(--card-bg);
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#theme-toggle-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#theme-toggle-btn:focus {
  outline: none;
}

#theme-toggle-btn:active {
  transform: scale(0.95);
}

#theme-toggle-btn i {
  font-size: 1.5rem;
  position: absolute;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bouncy transition */
}

#theme-toggle-btn .fa-sun {
  color: #ffc107;
  opacity: 0;
  transform: translateY(20px) rotate(-90deg);
}

#theme-toggle-btn .fa-moon {
  color: #adb5bd;
  opacity: 1;
  transform: translateY(0) rotate(0);
}

body.light-mode #theme-toggle-btn .fa-sun {
  opacity: 1;
  transform: translateY(0) rotate(0);
}

body.light-mode #theme-toggle-btn .fa-moon {
  opacity: 0;
  transform: translateY(-20px) rotate(90deg);
}

/* Theme ripple effect */
.theme-ripple {
  position: fixed;
  border-radius: 50%;
  transform: scale(0);
  z-index: -1;
  transition: transform 0.8s ease-out;
}

.theme-ripple.expand {
  transform: scale(1);
}

/* Footer */
footer {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}

footer:hover {
  opacity: 1;
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
  .theme-toggle {
    bottom: 1rem;
    right: 1rem;
  }
  
  #theme-toggle-btn {
    width: 48px;
    height: 48px;
  }
  
  .card-img-wrapper {
    height: 120px;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Theme Content Transition */
.theme-content-transition {
  animation: contentTransition 0.5s ease-in-out;
}

@keyframes contentTransition {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(0.98);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Header Strip Styles */
.header-strip {
  background-color: rgba(var(--header-bg-rgb), 0.85); /* 15% transparency */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 8px 0;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  z-index: 100;
  transition: background-color 0.5s ease;
  backdrop-filter: blur(5px); /* Adds a subtle blur to the background */
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-logo {
  height: 30px;
  width: auto;
  margin-right: 15px;
  transition: filter 0.5s ease;
}

body.dark-mode .header-logo {
  filter: brightness(0) invert(1); /* Make logo white in dark mode */
}

body.light-mode .header-logo {
  filter: brightness(0.2); /* Darken logo in light mode */
}

.header-title {
  display: flex;
  flex-direction: column;
}

.header-title h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.header-title p {
  font-size: 13px;
  margin: 0;
  opacity: 0.8;
  color: var(--text-color);
  line-height: 1.3;
}

.header-right {
  display: flex;
  align-items: center;
}

.weather-widget {
  color: var(--text-color);
  font-size: 15px;
  display: flex;
  align-items: center;
  font-weight: 400;
}

#current-date {
  margin-right: 15px;
}

#weather-container {
  display: flex;
  align-items: center;
}

#weather-loading {
  font-style: italic;
  opacity: 0.7;
}

#weather-data {
  display: flex;
  align-items: center;
}

#weather-icon {
  margin-right: 5px;
  color: var(--ulbrich-light-blue);
  font-size: 16px;
}

#weather-temp {
  font-weight: 600;
  margin-right: 5px;
}

#weather-desc {
  text-transform: capitalize;
  opacity: 0.85;
  font-size: 13px;
}

@media (max-width: 767.98px) {
  .header-container {
    padding: 0 1rem;
  }
  
  .header-title h1 {
    font-size: 18px;
  }
  
  .header-title p {
    font-size: 12px;
  }
  
  .weather-widget {
    font-size: 13px;
  }
  
  .section-title {
    font-size: 1.625rem;
  }
  
  .card-title {
    font-size: 1.05rem;
  }
  
  body {
    font-size: 15px;
  }
}

/* Add Source Sans Pro font */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600;700&display=swap');
