body {
  margin: 0;
  overflow: hidden;
  background-color: #1d63a3; /* Windows 7 default background color */
  font-family: 'Segoe UI', Tahoma, sans-serif;
  color: black;
}

canvas {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
}

/* Windows 7 themed container */
.win7-container {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

/* Window styling overrides for 7.css with glass effect */
.window {
  width: 600px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  border-radius: 3px !important;
  overflow: hidden;
  position: relative;
}

/* Glass effect for Windows 7 */
.window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.3) 100%);
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
  pointer-events: none;
  z-index: 2;
}

/* Add glass effect to title bar */
.title-bar {
  background: linear-gradient(to bottom, #2a8ad4 0%, #2a7ad2 100%) !important;
  position: relative;
  overflow: hidden;
}

.title-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
  pointer-events: none;
}

/* Animation for minimize */
.window.minimized {
  transform: scale(0.5);
  opacity: 0.5;
  transition: all 0.3s ease;
}

/* Window maximized state */
.window.maximized {
  width: 90% !important;
  height: 80% !important;
  top: 10% !important;
  left: 5% !important;
  transform: none !important;
  border-radius: 3px !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
  transition: all 0.3s ease;
}

.window.maximized .window-body {
  height: calc(100% - 30px);
  overflow-y: auto;
}

/* Resize handles */
.resize-handle {
  position: absolute;
  z-index: 1000;
  background-color: transparent;
}

.resize-n, .resize-s {
  height: 6px;
  width: 100%;
  left: 0;
}

.resize-n {
  top: -3px;
  cursor: n-resize;
}

.resize-s {
  bottom: -3px;
  cursor: s-resize;
}

.resize-e, .resize-w {
  height: 100%;
  width: 6px;
  top: 0;
}

.resize-e {
  right: -3px;
  cursor: e-resize;
}

.resize-w {
  left: -3px;
  cursor: w-resize;
}

.resize-ne, .resize-nw, .resize-se, .resize-sw {
  width: 10px;
  height: 10px;
}

.resize-ne {
  top: -3px;
  right: -3px;
  cursor: ne-resize;
}

.resize-nw {
  top: -3px;
  left: -3px;
  cursor: nw-resize;
}

.resize-se {
  bottom: -3px;
  right: -3px;
  cursor: se-resize;
}

.resize-sw {
  bottom: -3px;
  left: -3px;
  cursor: sw-resize;
}

.window-body {
  margin: 8px;
  padding: 5px;
  background-color: #f0f0f0 !important;
}

.maintenance-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.warning-icon {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}

h1 {
  font-size: 1.2rem;
  margin: 0;
  color: #000;
}

fieldset {
  margin-bottom: 15px;
}

.progress-container {
  margin: 15px 10px;
  padding: 8px;
  background-color: #f0f0f0;
  border: 1px solid #d1d1d1;
  border-radius: 2px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.win7-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.win7-progress-bar {
  height: 16px;
  border: 1px solid #b3b3b3;
  background-color: #e6e6e6;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.win7-progress-green {
  height: 100%;
  width: 45%;
  background: linear-gradient(to right, 
    #75e46b 0%, 
    #4cc242 50%, 
    #3baf30 51%, 
    #60d056 100%);
  background-size: 30px 100%;
  animation: progress-move 0.7s linear infinite;
  position: relative;
  box-shadow: 0 0 3px rgba(0,180,0,0.3);
}

@keyframes progress-move {
  0% { background-position: 0 0; }
  100% { background-position: 30px 0; }
}

.win7-progress-details {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #555;
  line-height: 1.4;
}

/* Improved window button styles to match Windows 7 */
.title-bar {
  background: linear-gradient(to bottom, #2a8ad4 0%, #2a7ad2 100%);
  cursor: move; /* Indicate the title bar is draggable */
}

.title-bar-text {
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* Window control buttons */
.title-bar-controls button {
  transition: background-color 0.1s ease;
}

.title-bar-controls button[aria-label="Minimize"]:hover {
  background-color: #e5c365;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='6' height='2' fill='rgba(0, 0, 0, 0.7)' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h6v2H0z'/%3E%3C/svg%3E");
}

.title-bar-controls button[aria-label="Maximize"]:hover {
  background-color: #65e58c;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='9' height='9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.7)' d='M0 0h9v9H0z'/%3E%3C/svg%3E");
}

.title-bar-controls button[aria-label="Close"]:hover {
  background-color: #e55c5c;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='7' fill='rgba(0, 0, 0, 0.7)' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0z'/%3E%3C/svg%3E");
}

/* Fix for warning icon */
.warning-icon {
  width: 32px;
  height: 32px;
  margin-right: 10px;
  display: inline-block;
}

/* Close dialog button */
.close-window-btn {
  margin-top: 10px;
  float: right;
}

/* Status bar */
.status-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  border: 1px inset #d4d0c8;
  padding: 2px 5px;
  background-color: #f0f0f0;
}

.status-bar-field {
  margin: 0;
  font-size: 0.8rem;
}

/* Animation for the progress bar */
@keyframes progress-animation {
  0% { width: 0%; }
  10% { width: 15%; }
  20% { width: 24%; }
  30% { width: 35%; }
  40% { width: 42%; }
  50% { width: 54%; }
  60% { width: 62%; }
  70% { width: 71%; }
  80% { width: 83%; }
  90% { width: 91%; }
  95% { width: 97%; }
  100% { width: 99%; }
}

progress {
  animation: progress-animation 8s infinite;
  animation-timing-function: ease-in-out;
}

/* Custom button styling to match Windows 7 */
button {
  margin-left: 5px;
}

/* Dialog overlay */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.dialog {
  width: 400px !important;
  max-height: 80vh;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

/* Draggable effect */
.window:active {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6) !important;
}

/* Hover effects for the window */
.window:hover .title-bar {
  background: linear-gradient(to bottom, #3095e3 0%, #2a7ad2 100%);
}

/* Email form window styles */
.email-form-window {
  width: 650px !important;
  max-height: 85vh;
  overflow-y: auto;
}

/* Window animations */
.window-opening {
  animation: window-open-animation 0.4s ease-out forwards;
  transform-origin: center bottom;
}

.window-closing {
  animation: window-close-animation 0.3s ease-in forwards;
  transform-origin: center bottom;
}

.dialog-opening {
  animation: dialog-open-animation 0.3s ease-out forwards;
}

.dialog-closing {
  animation: dialog-close-animation 0.2s ease-in forwards;
}

@keyframes window-open-animation {
  0% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes window-close-animation {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
}

@keyframes dialog-open-animation {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes dialog-close-animation {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
  }
}

/* Form field styles */
.win7-form fieldset {
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #bbb;
  border-radius: 2px;
}

.win7-form legend {
  font-size: 12px;
  color: #333;
  padding: 0 5px;
}

.win7-form .field-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.win7-form .field-row.vertical {
  flex-direction: column;
  align-items: flex-start;
}

.win7-form .field-row label {
  min-width: 80px;
  margin-right: 10px;
  font-size: 12px;
}

.win7-form .field-row input,
.win7-form .field-row textarea {
  flex: 1;
  min-width: 200px;
  padding: 4px;
  border: 1px solid #7a7a7a;
  border-radius: 2px;
  background-color: white;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.win7-form .field-row input:focus,
.win7-form .field-row textarea:focus {
  border-color: #3078ca;
  outline: none;
  box-shadow: 0 0 3px rgba(48,120,202,0.5), inset 0 1px 2px rgba(0,0,0,0.1);
}

.win7-form .field-row textarea {
  resize: vertical;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 12px;
}

.win7-form .field-row-last {
  justify-content: flex-end;
  margin-top: 15px;
}

.win7-form button {
  min-width: 80px;
  margin-left: 8px;
}

.win7-form button.clicked {
  animation: button-click 0.2s ease;
}

@keyframes button-click {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* Verification row */
.verification-row {
  justify-content: center;
  margin: 5px 0;
}

/* Math challenge styles */
.math-challenge {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0;
  padding: 15px;
  background-color: #f0f0f0;
  border: 1px solid #d1d1d1;
  border-radius: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease;
}

.math-challenge.challenge-updated {
  background-color: #e5f1fb;
  animation: challenge-pulse 0.5s ease;
}

@keyframes challenge-pulse {
  0% { background-color: #f0f0f0; }
  50% { background-color: #e5f1fb; }
  100% { background-color: #f0f0f0; }
}

.math-problem {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.math-problem input {
  width: 60px;
  height: 26px;
  padding: 2px 5px;
  font-size: 16px;
  border: 1px solid #7a7a7a;
  border-radius: 2px;
  text-align: center;
}

.math-instructions {
  font-size: 12px;
  color: #555;
  text-align: center;
  margin-top: 5px;
}

/* Typing effect */
.typing-effect {
  position: relative;
}

.typing-effect::after {
  content: '|';
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  animation: cursor-blink 0.7s infinite;
  font-weight: bold;
  color: #0078d7;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Form sending progress animation */
.sending-progress {
  animation: sending-progress-move 1s linear infinite;
}

@keyframes sending-progress-move {
  0% { background-position: 0 0; }
  100% { background-position: 30px 0; }
}

/* RSS Feed Styles */
.rss-feed-window {
  width: 700px !important;
  max-height: 85vh;
  overflow-y: auto;
}

.rss-feed-container {
  max-height: 60vh;
  overflow-y: auto;
  padding: 5px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
}

.rss-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d1d1d1;
}

.rss-header h3 {
  margin: 0;
  font-size: 16px;
  color: #1a73e8;
}

.rss-description {
  font-size: 12px;
  color: #555;
  margin: 5px 0 0 0;
}

.rss-items {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.rss-item {
  padding: 10px;
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.rss-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.rss-item-header h4 {
  margin: 0;
  font-size: 14px;
  color: #333;
  flex: 1;
}

.rss-date {
  font-size: 11px;
  color: #666;
  white-space: nowrap;
  margin-left: 10px;
}

.rss-content {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 10px;
  color: #444;
  max-height: 150px;
  overflow-y: auto;
}

.rss-content img {
  max-width: 100%;
  height: auto;
  margin: 5px 0;
}

.rss-item-footer {
  text-align: right;
  padding-top: 5px;
}

.rss-link {
  display: inline-block;
  padding: 2px 8px;
  background: linear-gradient(to bottom, #f0f0f0 0%, #e3e3e3 100%);
  border: 1px solid #ccc;
  border-radius: 2px;
  color: #0066cc;
  text-decoration: none;
  font-size: 11px;
}

.rss-link:hover {
  background: linear-gradient(to bottom, #e5f1fb 0%, #d8ebf8 100%);
  border-color: #0078d7;
}

.loading-indicator {
  padding: 20px;
  text-align: center;
}

.loading-text {
  margin-top: 10px;
  font-size: 12px;
  color: #555;
}

.rss-error {
  padding: 15px;
  background-color: #fff5f5;
  border: 1px solid #ffd5d5;
  color: #d83b01;
  text-align: center;
  border-radius: 2px;
}

.error-details {
  font-size: 11px;
  margin-top: 5px;
  color: #777;
}

.no-items {
  text-align: center;
  color: #666;
  padding: 20px;
  font-style: italic;
}

/* Radio Player Styles */
.radio-player-window {
  width: 500px !important;
  max-height: 80vh;
  overflow: hidden;
}

.radio-player-container {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.radio-station-info {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #d1d1d1;
  border-radius: 3px;
  background-color: #f9f9f9;
}

.radio-logo {
  width: 100px;
  height: auto;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-logo img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
}

.radio-details h3 {
  margin: 0 0 5px 0;
  font-size: 1.2em;
}

.radio-details p {
  margin: 0 0 8px 0;
  font-size: 0.9em;
  color: #555;
}

.radio-status {
  font-size: 0.85em;
  font-style: italic;
  color: #0066cc;
}

/* Custom audio controls */
.radio-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.radio-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

#volume-slider {
  width: 100px;
}

/* Progress bar for radio */
.progress-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.radio-progress-bar {
  width: 100%;
  height: 16px;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

#audio-progress-bar {
  height: 100%;
  background: linear-gradient(to bottom, #a9e47f 0%,#7dc45d 100%);
  width: 0%;
  transition: width 0.3s;
}

.sending-progress {
  background: linear-gradient(to right, #a9e47f 0%, #7dc45d 50%, #a9e47f 100%);
  background-size: 200% 100%;
  animation: progress-bar-animation 2s linear infinite;
}

@keyframes progress-bar-animation {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.time-display {
  font-size: 0.8em;
  text-align: right;
  color: #555;
}

/* Now playing section */
.now-playing {
  margin-top: 10px;
}

.now-playing-info {
  min-height: 20px;
}

.marquee {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

.marquee span {
  display: inline-block;
  animation: marquee 15s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Radio quality selector */
.radio-quality {
  margin-top: 10px;
}

/* Allow native audio controls as fallback */
#radio-audio {
  width: 100%;
  display: none; /* Hide native controls when we use custom controls */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .window {
    width: 90% !important;
    max-width: 500px;
  }
  
  h1 {
    font-size: 1rem;
  }
  
  .field-row label {
    min-width: 60px;
  }
  
  .dialog {
    width: 90% !important;
    max-width: 350px;
  }
  
  .email-form-window {
    width: 95% !important;
    max-width: 550px;
  }
  
  .win7-form .field-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .win7-form .field-row label {
    margin-bottom: 4px;
  }
  
  .win7-form .field-row input,
  .win7-form .field-row textarea {
    width: 100%;
    min-width: unset;
  }
}

/* Hidden elements */
.hidden-checkbox {
  display: none;
}

/* Contact form styling */
.win7-form {
  margin-top: 15px;
}

.form-status {
  margin-top: 10px;
  padding: 5px;
  min-height: 20px;
  font-size: 12px;
}

.form-status.sending {
  color: #0078d7;
  background-color: #e5f1fb;
  border: 1px solid #b3d6f2;
}

.form-status.success {
  color: #107c10;
  background-color: #e5f1e5;
  border: 1px solid #b3d6b3;
}

.form-status.error {
  color: #d83b01;
  background-color: #fde7e9;
  border: 1px solid #f1b3b3;
}