/*
 * Christmas Theme Base Layout
 * Festive red hero pattern with green accents
 */

/* Body with Hero Pattern Background */
body {
  background-color: var(--bg-hero-pattern);
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.15'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  min-height: 100vh;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Container with glass overlay for readability */
.container,
.content-wrapper {
  padding: 30px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  contain: layout style paint;
  will-change: transform;
}

/* Modals with glass effect */
.modal-content,
.confirm-box,
.confirm-modal-content {
  background: rgba(255, 255, 255, 0.98) !important;
  /* Removed backdrop-filter for performance */
  contain: layout style;
}

/* Dropdowns and select menus */
.custom-select-dropdown,
.custom-select-trigger {
  background: rgba(255, 255, 255, 0.98);
  /* Removed backdrop-filter for performance */
}

/* Cards with glass effect */
.member-card,
.role-card,
.participant-card,
.pair-card {
  background: rgba(255, 255, 255, 0.88) !important;
  /* Removed backdrop-filter for performance */
  contain: layout style paint;
  transform: translateZ(0);
  will-change: transform;
}

.member-card:hover,
.role-card:hover {
  background: rgba(255, 255, 255, 0.92) !important;
}

/* Variable hints and previews */
.variable-hint,
.message-preview {
  background: rgba(255, 255, 255, 0.88) !important;
  /* Removed backdrop-filter for performance */
}

.variable-hint code {
  background: rgba(255, 255, 255, 0.95) !important;
}

/* Primary Buttons - Christmas Green */
.btn-primary,
.btn-login,
.modal-btn-primary,
button[type="submit"] {
  background: var(--primary-green) !important;
  color: var(--white);
  border: none;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  transform: translateZ(0);
  will-change: transform;
}

.btn-primary:hover,
.btn-login:hover,
.modal-btn-primary:hover,
button[type="submit"]:hover {
  background: var(--primary-green-dark) !important;
  transform: translateY(-2px) translateZ(0);
  box-shadow: 0 4px 12px rgba(45, 122, 62, 0.4);
}

/* Secondary Buttons */
.btn-secondary {
  background: var(--christmas-red);
  color: var(--white);
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn-secondary:hover {
  background: var(--christmas-red-dark);
  transform: translateY(-2px) translateZ(0);
}

/* Cards and Panels */
.card,
.panel,
.server-card,
.session-card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  contain: layout style paint;
  transform: translateZ(0);
  will-change: transform;
}

.card:hover,
.server-card:hover,
.session-card:hover {
  transform: translateY(-4px) translateZ(0);
  box-shadow: 0 8px 24px rgba(45, 122, 62, 0.2);
}

/* Headers and Titles */
h1, h2, h3 {
  color: var(--primary-green-dark);
}

/* Links */
a {
  color: var(--primary-green);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-green-dark);
}

/* Inputs and Forms */
input,
textarea,
select {
  border: 2px solid var(--gray-medium);
  border-radius: var(--radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.1);
}

/* Buttons focus state */
button:focus,
.btn:focus,
.btn-primary:focus,
.btn-secondary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.2);
}

/* Links focus state */
a:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* Remove all default blue outlines */
*:focus {
  outline-color: var(--primary-green);
}

/* Badges and Tags */
.badge,
.tag {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-xl);
  font-size: var(--font-xs);
  font-weight: 600;
}

.badge-success {
  background: var(--success-green);
  color: var(--white);
}

.badge-error {
  background: var(--error-red);
  color: var(--white);
}

.badge-warning {
  background: var(--warning-orange);
  color: var(--white);
}

.badge-info {
  background: var(--info-blue);
  color: var(--white);
}

/* Status Badges - Christmas Theme Colors */
.status-draft {
  background: var(--status-draft);  /* Orange - In progress */
  color: var(--white);
}

.status-shuffled {
  background: var(--status-shuffled);  /* Festive Gold - Shuffled */
  color: var(--white);
}

.status-active {
  background: var(--status-active);  /* Christmas Green - Active */
  color: var(--white);
}

.status-completed {
  background: var(--status-completed);  /* Gray - Completed */
  color: var(--white);
}

/* Christmas Decorations */
.christmas-decoration {
  position: relative;
}

.christmas-decoration::before {
  content: '🎄';
  position: absolute;
  font-size: 2em;
  opacity: 0.3;
}

/* Festive Accents */
.festive-accent {
  border-left: 4px solid var(--primary-green);
  padding-left: var(--spacing-md);
}

.festive-border {
  border: 2px solid var(--primary-green);
}

/* Header with Christmas Theme */
.header {
  background: rgba(255, 255, 255, 0.92);
  /* Removed backdrop-filter for performance */
  border-bottom: 3px solid var(--primary-green);
}

/* Footer */
.footer {
  background: rgba(255, 255, 255, 0.92);
  /* Removed backdrop-filter for performance */
  border-top: 3px solid var(--primary-green);
  padding: var(--spacing-lg);
  text-align: center;
  color: var(--text-dark);
}

/* Loading States */
.loading {
  text-align: center;
  padding: 40px;
  font-size: 1.2em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.loading::after {
  content: '';
  display: block;
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  transform: translateZ(0);
  will-change: transform;
}

@keyframes spin {
  to { transform: rotate(360deg) translateZ(0); }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--gray-light);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-green);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-green-dark);
}

/* Selection Color */
::selection {
  background: var(--primary-green);
  color: var(--white);
}

::-moz-selection {
  background: var(--primary-green);
  color: var(--white);
}

/* Responsive Adjustments - MOBILE OPTIMIZATIONS */
@media (max-width: 768px) {
  /* Keep SVG pattern but optimize */
  body {
    background-size: 40px 40px; /* Slightly smaller for mobile */
  }
  
  /* Simplify animations on mobile */
  .loading::after {
    animation-duration: 1s;
  }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    background-size: 30px 30px; /* Smaller pattern for better performance */
  }
}

/* Performance Enhancements - CSS Containment */
.panel,
.card,
.server-card,
.session-card,
.action-card,
.participant-item {
  contain: layout style paint;
}

/* Optimized scrollable areas */
.participant-list,
.checkbox-list,
.custom-select-dropdown,
.session-list {
  contain: layout style;
  will-change: scroll-position;
}

/* Ensure smooth animations */
.santa,
.btn {
  transform: translateZ(0);
  will-change: transform;
}
