:root {
  --primary-shadow: 0 2px 4px rgba(0,0,0,0.1);
  --secondary-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --border-radius: 8px;
  --bg-light: #f8f9fa;
  --text-muted: #7f8c8d;
  --text-dark: #2c3e50;
  --border-light: #dee2e6;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--bg-light);
}

.page-grid {
  display: grid;
  grid-template-areas:
    "header header header"
    "left main right"
    "footer footer footer";
  grid-template-columns: 250px 1fr 250px;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  gap: 1rem;
  padding: 1rem;
}

/* Header Area */
.header-area {
  grid-area: header;
  background-color: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--primary-shadow);
}

.header-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
}

.logo {
  height: 100px;
  width: auto;
}

.site-title {
  margin-left: 2rem;
  text-align: right;
  margin-right: 2rem;
}

.header-welcome-heading {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text-dark);
  font-weight: 600;
  text-align: right;
}

.welcome-subtext {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: right;
}

/* Language switcher */
.language-switcher-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
  box-shadow: var(--secondary-shadow);
  margin: 0;
  width: fit-content;
}

.language-switcher {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.language-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  opacity: 0.6;
  transition: opacity 0.3s, transform 0.2s;
}

.language-btn:hover, .language-btn.active {
  opacity: 1;
  transform: scale(1.1);
}

.flag-icon {
  width: 32px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

/* Left Sidebar - Updated with Modern Gradient Buttons */
.left-sidebar {
  grid-area: left;
  background-color: white;
  padding: 1rem;
  border-radius: var(--border-radius); 
  box-shadow: var(--primary-shadow);
}

/* Modern Gradient Button Styles */
.left-sidebar .btn {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border: none;
  color: white;
  font-weight: 500;
  border-radius: 12px;
  padding: 12px 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.left-sidebar .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  color: white;
}

.left-sidebar .btn:active {
  transform: translateY(0);
}

.left-sidebar .btn:focus {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4), 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
  color: white;
}

/* Icon styling for buttons */
.left-sidebar .btn i {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Remove Bootstrap color overrides for modern gradient */
.left-sidebar .btn.btn-primary,
.left-sidebar .btn.btn-info,
.left-sidebar .btn.btn-success,
.left-sidebar .btn.btn-warning,
.left-sidebar .btn.btn-danger,
.left-sidebar .btn.btn-secondary {
  background: linear-gradient(45deg, #667eea, #764ba2);
  border: none;
  color: white;
}

.left-sidebar .btn.btn-primary:hover,
.left-sidebar .btn.btn-info:hover,
.left-sidebar .btn.btn-success:hover,
.left-sidebar .btn.btn-warning:hover,
.left-sidebar .btn.btn-danger:hover,
.left-sidebar .btn.btn-secondary:hover {
  background: linear-gradient(45deg, #667eea, #764ba2);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  color: white;
}

.left-sidebar .btn.btn-primary:focus,
.left-sidebar .btn.btn-info:focus,
.left-sidebar .btn.btn-success:focus,
.left-sidebar .btn.btn-warning:focus,
.left-sidebar .btn.btn-danger:focus,
.left-sidebar .btn.btn-secondary:focus {
  background: linear-gradient(45deg, #667eea, #764ba2);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4), 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
  color: white;
}

.left-sidebar .btn.btn-primary:active,
.left-sidebar .btn.btn-info:active,
.left-sidebar .btn.btn-success:active,
.left-sidebar .btn.btn-warning:active,
.left-sidebar .btn.btn-danger:active,
.left-sidebar .btn.btn-secondary:active {
  background: linear-gradient(45deg, #667eea, #764ba2);
  transform: translateY(0);
  color: white;
}

/* Ensure proper width and spacing */
.left-sidebar .btn.w-100 {
  width: 100% !important;
  margin-bottom: 0.5rem;
}

/* Remove the old translateX hover effect */
.left-sidebar .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Main Content */
.main-content {
  grid-area: main;
  background-color: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--primary-shadow);
}

/* Right Sidebar */
.right-sidebar {
  grid-area: right;
  background-color: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--primary-shadow);
}

/* Standardized widget styling */
.weather-widget, .calendar-widget, .radio-widget,
.google-search-widget, .currency-widget, .rss-widget {
  background-color: var(--bg-light);
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--secondary-shadow);
  margin-bottom: 1rem;
}

/* Calendar widget */
.calendar-widget-compact {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.calendar-header {
  text-align: center;
  font-weight: 500;
  color: #333;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}

.calendar-table {
  width: 100%;
  border-collapse: collapse;
}

.calendar-table th {
  text-align: center;
  padding: 0.3rem;
  font-size: 0.8rem;
  color: #666;
}

.calendar-table td {
  text-align: center;
  padding: 0.3rem;
  font-size: 0.9rem;
}

.calendar-table .current-day {
  background-color: #e9ecef;
  border-radius: 50%;
  font-weight: bold;
}

/* Weather widget */
.weather-widget-compact {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.weather-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  text-align: left;
  width: 100%;
}

.weather-city {
  font-weight: 500;
  font-size: 1rem;
  color: #333;
}

.weather-condition {
  color: #666;
  text-transform: capitalize;
  font-size: 0.8rem;
}

.weather-details {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
}

.weather-icon {
  width: 40px;
  height: 40px;
}

.weather-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
}

.weather-temp {
  font-weight: 500;
}

.humidity-info {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #666;
}

.humidity-icon {
  color: #4a90e2;
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* Light Theme Footer */
.footer-area {
  grid-area: footer;
  background-color: var(--bg-light); /* Match body background */
  color: var(--text-dark);
  padding: 2rem 1rem 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--primary-shadow);
  position: relative;
  overflow: hidden;
}

/* Triangle pattern for light theme */
.footer-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" fill="rgba(0,0,0,0.02)"><polygon points="0,0 1000,100 1000,0"/></svg>');
  pointer-events: none;
}

.footer-content {
  position: relative;
  z-index: 2;
}

.footer-sections {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  min-width: 0;
}

/* Card-style sections */
.footer-section {
  background-color: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--secondary-shadow);
  min-width: 180px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-section:hover {
  transform: translateY(-2px);
  box-shadow: var(--primary-shadow);
}

.footer-section h4 {
  color: var(--text-dark);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-section h4 i {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links-list li {
  margin-bottom: 0.5rem;
}

.footer-links-list a {
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-radius: 4px;
  font-size: 0.9rem;
}

.footer-links-list a:hover {
  color: var(--text-dark);
  background-color: rgba(0, 0, 0, 0.05);
  padding-left: 0.5rem;
  transform: translateX(5px);
}

.footer-links-list img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  border-radius: 2px;
}

.footer-links-list a i {
  font-size: 0.8rem;
  width: 16px;
  text-align: center;
}

.footer-bottom {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--secondary-shadow);
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-bottom a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-bottom a:hover {
  color: var(--text-dark);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-link:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-dark);
  transform: translateY(-2px);
}

.contact-info {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.9rem;
}

.contact-info p {
  margin-bottom: 0.5rem;
}

.contact-info i {
  margin-right: 0.5rem;
  color: var(--text-muted);
  width: 16px;
  text-align: center;
}

/* Responsive footer */
@media (max-width: 1200px) {
  .footer-sections {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .footer-sections {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .footer-area {
    padding: 1.5rem 1rem 1rem;
  }
  
  .social-links {
    flex-wrap: wrap;
  }
  
  .footer-section {
    min-width: unset;
  }
}

/* Profile Area */
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
}

.profile-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--bg-light);
  border-radius: var(--border-radius);
  box-shadow: var(--secondary-shadow);
}

.profile-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profile-picture {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* Radio widget */
.radio-widget-compact {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.radio-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  text-align: left;
  width: 100%;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
  position: relative;
}

.radio-icon {
  color: #007bff;
  pointer-events: none;
}

.radio-title {
  font-weight: 500;
  font-size: 1rem;
  color: #333;
}

.radio-player-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem 0;
}

#custom-radio-player {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.radio-station-selector {
  margin-bottom: 0.5rem;
}

.radio-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.radio-control-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: transform 0.2s, opacity 0.3s;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-grow: 1;
}

.custom-range {
  height: 0.5rem;
}

.radio-info {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  min-height: 1.5rem;
}

.radio-station-logo {
  position: absolute;
  right: 0;
  top: 30%;
  transform: translateY(-50%);
  height: 24px;
  width: auto;
  object-fit: contain;
}

/* Radio Web App Button Spacing */
.radio-webapp-button .btn i {
  margin-right: 0.5rem;
}

/* Google Search Widget */
.google-search-widget-compact {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}
.google-search-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  text-align: left;
  width: 100%;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
  position: relative;
}
.google-logo {
  height: 20px;
  width: auto;
}
.google-search-title {
  font-weight: 500;
  font-size: 1rem;
  color: #333;
}
.google-search-container {
  padding: 0.5rem 0;
}
.google-search-container .input-group {
  box-shadow: var(--secondary-shadow);
  border-radius: 20px;
  overflow: hidden;
}
.google-search-container .form-control {
  border-radius: 20px 0 0 20px;
  border-right: none;
}
.google-search-container .btn {
  border-radius: 0 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
}
.google-search-container .form-control:focus {
  box-shadow: none;
  border-color: #ced4da;
}
.google-search-container .input-group:focus-within {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Currency widget */
.currency-widget-compact {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.currency-header {
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.currency-title {
  font-weight: 500;
  font-size: 1rem;
  color: #333;
}

.currency-rates {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.currency-rate {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.text-danger {
  color: #dc3545;
}

/* RSS Feed Style */
.rss-widget-compact {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

.rss-header {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  text-align: left;
  width: 100%;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.rss-title {
  font-weight: 500;
  font-size: 1rem;
  color: #333;
}

.rss-feed-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rss-item {
  padding: 0.3rem 0;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
}

.rss-item-title {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.rss-item-title:hover {
  color: #0056b3;
  text-decoration: underline;
}

.rss-item-date {
  color: #666;
  font-size: 0.7rem;
  margin-top: 0.2rem;
}

.rss-feed-container .text-danger {
  color: #dc3545;
  text-align: center;
}

/* Online users style */
.online-users-widget-compact {
  background: var(--widget-bg, #f8f9fa);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.85rem;
  box-shadow: var(--secondary-shadow); /* Added shadow like search widget */
}

.online-users-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--widget-header-color, #333);
  border-bottom: 1px solid var(--border-light); /* Added bottom border like search widget */
  padding-bottom: 0.5rem; /* Added padding like search widget */
}

.online-users-icon {
  color: var(--primary-color, #007bff);
}

.online-indicator {
  width: 8px;
  height: 8px;
  background-color: #28a745;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.online-stats {
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color, #333);
}

.users-list {
  margin-bottom: 8px;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--user-item-bg, rgba(0,0,0,0.05));
}

.user-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-muted, #666);
}

.user-role.admin {
  color: var(--danger-color, #dc3545);
  font-weight: 600;
}

.anonymous-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted, #666);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-grid {
    grid-template-areas:
      "header"
      "main"
      "left"
      "right"
      "footer";
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto auto;
  }
  
  .header-content {
    grid-template-columns: auto 1fr;
  }
  
  .site-title {
    text-align: left;
    margin-left: 1rem;
    margin-right: 0;
  }
  
  .header-right {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 1rem;
  }
  
  .header-welcome-heading, .welcome-subtext {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .header-right {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  
  .language-switcher-container {
    width: 100%;
  }
  
  .profile-container {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .page-grid {
    grid-template-areas:
      "header"
      "main"
      "left"
      "right"
      "footer";
    grid-template-columns: 1fr;
  }

  .left-sidebar,
  .right-sidebar {
    padding: 0.5rem;
  }
}

@media (max-width: 576px) {
  .logo {
    height: 60px;
  }
  
  .header-welcome-heading {
    font-size: 1.2rem;
  }
  
  .page-grid {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .header-area, .left-sidebar, .main-content, .right-sidebar, .footer-area {
    padding: 0.75rem;
    border-radius: 6px;
  }
  
  .weather-widget, .calendar-widget, .radio-widget, 
  .google-search-widget, .currency-widget, .rss-widget {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
  }
}

/* Bootstrap 5.3.2 compatibility fixes */
.form-select:focus, .form-control:focus {
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
  border-color: #86b7fe;
}

/* Last widget should not have bottom margin */
.right-sidebar > div:last-child {
  margin-bottom: 0;
}

/* Make alerts dismissible and add transition */
.alert {
  transition: opacity 0.3s ease;
}

.alert.fade {
  opacity: 0;
}

.alert.show {
  opacity: 1;
}