/**
 * Würfelpoker Tracker - Modern Theme System
 * Enhanced design with dark mode support and glassmorphism effects
 * 
 * @author Würfelpoker Tracker Team
 * @version 2.0.0
 */

/* CSS Custom Properties for Theme System */
:root {
  /* Light Theme Colors */
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e9ecef;
  --bg-glass: rgba(255, 255, 255, 0.8);
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-accent: #0d6efd;
  --border-color: #dee2e6;
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.15);
  
  /* Theme Transition */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Colors */
[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-tertiary: #2d2d2d;
  --bg-glass: rgba(30, 30, 30, 0.8);
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --text-accent: #4dabf7;
  --border-color: #404040;
  --shadow-sm: 0 2px 10px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

/* Base Styles */
* {
  transition: var(--transition);
}

body {
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Header Branding */
.header-brand {
  font-weight: 700;
  letter-spacing: 0.3px;
  background: linear-gradient(45deg, var(--text-accent), #6610f2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#landing-page {
  padding: 4rem 0;
}

/* Modern Card System */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  border-radius: 16px;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--text-primary);
}

/* Enhanced Navbar */
.navbar {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-sm);
}

/* Modern Buttons */
.btn {
  border-radius: 12px;
  font-weight: 500;
  transition: var(--transition);
  border-width: 2px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: linear-gradient(45deg, #0d6efd, #6610f2);
  border-color: transparent;
}

.btn-success {
  background: linear-gradient(45deg, #198754, #20c997);
  border-color: transparent;
}

.btn-outline-primary:hover {
  background: linear-gradient(45deg, #0d6efd, #6610f2);
}

/* Enhanced Tables */
.table {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
  font-weight: 600;
  text-align: center;
}

.table td {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
  text-align: center;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
  background: var(--bg-glass);
}

/* Category Column Styling */
.category-col {
  width: 60px;
  min-width: 60px;
  max-width: 60px;
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Modern Badges */
.badge {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

/* Enhanced Alerts */
.alert {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
}

.alert-primary {
  background: linear-gradient(45deg, rgba(13, 110, 253, 0.1), rgba(102, 16, 242, 0.1));
  border-color: var(--text-accent);
  color: var(--text-accent);
}

.alert-info {
  background: linear-gradient(45deg, rgba(13, 202, 240, 0.1), rgba(102, 16, 242, 0.1));
}

/* Modern Form Controls */
.form-control {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  transition: var(--transition);
}

.form-control:focus {
  background: var(--bg-secondary);
  border-color: var(--text-accent);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
  color: var(--text-primary);
}

.form-label {
  color: var(--text-primary);
  font-weight: 500;
}

/* Dark Mode Toggle Switch */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.theme-switch {
  position: relative;
  width: 60px;
  height: 30px;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  margin: 0;
  z-index: 2;
}

.theme-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, #ffd700, #ffb347);
  border-radius: 15px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

.theme-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.theme-switch input:checked + .theme-slider {
  background: linear-gradient(45deg, #2c3e50, #34495e);
}

.theme-switch input:checked + .theme-slider:before {
  transform: translateX(30px);
  background: #f39c12;
}

.theme-icon {
  font-size: 1.2rem;
  transition: var(--transition);
  cursor: default;
}

/* Hover effects */
.theme-switch:hover .theme-slider {
  box-shadow: var(--shadow-md);
}

/* Modal Enhancements */
.modal-content {
  background: var(--bg-glass);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  background: transparent;
}

.modal-title {
  color: var(--text-primary);
  font-weight: 600;
}

.modal-body {
  color: var(--text-primary);
}

/* Player Name Display */
.player-info {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  text-align: center;
}

.player-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
}

.player-status {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Responsive Improvements */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .card {
    border-radius: 12px;
  }
  
  .btn {
    border-radius: 8px;
  }
  
  .theme-toggle {
    margin-left: 0.5rem;
  }
  
  .theme-switch {
    width: 50px;
    height: 25px;
  }
  
  .theme-slider:before {
    height: 17px;
    width: 17px;
    left: 4px;
    bottom: 4px;
  }
  
  input:checked + .theme-slider:before {
    transform: translateX(25px);
  }
}

/* Animation Enhancements */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: slideIn 0.3s ease-out;
}

.numpad-btn,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-success
 {
  background-color: white;
}

/* Focus States */
.btn:focus,
.form-control:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

[data-theme="dark"] .btn:focus,
[data-theme="dark"] .form-control:focus {
  box-shadow: 0 0 0 3px rgba(77, 171, 247, 0.25);
}

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

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-accent);
}
