/* Import Cinzel font */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

:root {
  --font-heiti: 'Noto Sans SC', 'Microsoft YaHei', '微软雅黑', sans-serif;
  --gold: #e4cb86;
  --gold-hover: #d6bd78;
  --dark-bg: #000000;
  --card-bg: rgba(255, 255, 255, 0.05);
  --border-color: rgba(228, 203, 134, 0.3);
}

body, html {
  background-color: var(--dark-bg);
  color: white;
  min-height: 100vh;
  font-family: var(--font-heiti);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-weight: 300;
}

* {
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  box-sizing: border-box;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  color: white;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.2;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}

.container {
  max-width: 1400px;
  padding: 2rem;
  margin: 0 auto;
}

/* Card styling */
.card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card .card-header {
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
}

.card .card-body {
  padding: 1.5rem;
}

.card-title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

/* Button styling */
.btn {
  font-family: var(--font-heiti);
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 0.5rem 1rem;
}

/* Button styling overrides */
button, .btn, a.btn, input[type="button"], input[type="submit"], input[type="reset"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  touch-action: manipulation;
}

button:focus, .btn:focus, a.btn:focus, 
button:active, .btn:active, a.btn:active,
button:-moz-focus-inner, .btn:-moz-focus-inner, a.btn:-moz-focus-inner {
  outline: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  border-color: inherit !important;
}

.btn-primary {
  background-color: var(--gold);
  color: black;
  border: none;
}

.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
  background-color: var(--gold-hover);
  color: black;
  transform: translateY(-2px);
}

.btn-primary:focus, .btn-primary:active, .btn-primary.active, .btn-primary:hover, 
.btn-primary:active:focus, .btn-primary:active:hover, .btn-primary.active:focus, 
.btn-primary.active:hover, .btn-primary:active:hover, .open > .dropdown-toggle.btn-primary,
.open > .dropdown-toggle.btn-primary:focus, .open > .dropdown-toggle.btn-primary:hover {
  background-color: var(--gold-hover) !important;
  border-color: var(--gold-hover) !important;
  color: black !important;
}

.btn-outline-secondary {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
}

.btn-outline-secondary:hover, .btn-outline-secondary:active, .btn-outline-secondary:focus {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-outline-secondary:focus, .btn-outline-secondary:active, .btn-outline-secondary.active,
.btn-outline-secondary:active:focus, .btn-outline-secondary:active:hover, 
.btn-outline-secondary.active:focus, .btn-outline-secondary.active:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: white !important;
}

.btn-danger {
  background-color: #ff6b6b;
  border-color: #ff6b6b;
  color: white;
}

.btn-danger:hover, .btn-danger:active, .btn-danger:focus {
  background-color: #ff5252;
  border-color: #ff5252;
  color: white;
}

.btn-danger:focus, .btn-danger:active, .btn-danger.active, 
.btn-danger:active:focus, .btn-danger:active:hover,
.btn-danger.active:focus, .btn-danger.active:hover {
  background-color: #ff5252 !important;
  border-color: #ff5252 !important;
  color: white !important;
}

.btn-outline-success {
  border: 1px solid var(--border-color);
  color: var(--gold);
  background: transparent;
}

.btn-outline-success:hover, .btn-outline-success:active, .btn-outline-success:focus {
  background: rgba(228, 203, 134, 0.1);
  border-color: rgba(228, 203, 134, 0.5);
  color: white;
}

.btn-outline-success:focus, .btn-outline-success:active, .btn-outline-success.active,
.btn-outline-success:active:focus, .btn-outline-success:active:hover, 
.btn-outline-success.active:focus, .btn-outline-success.active:hover {
  background-color: rgba(228, 203, 134, 0.1) !important;
  border-color: rgba(228, 203, 134, 0.5) !important;
  color: white !important;
}

/* Alert styling */
.alert {
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: none;
}

.alert-danger {
  background-color: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
  border-left: 4px solid #ff6b6b;
}

/* Dropdown styling */
.dropdown-menu {
  background-color: rgba(10, 10, 10, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 0.5rem 0;
}

.dropdown-item {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.35rem 1.2rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: rgba(228, 203, 134, 0.1);
  color: white;
}

.dropdown-divider {
  border-top-color: rgba(255, 255, 255, 0.1);
  margin: 0.25rem 0;
}

.dropdown-item.text-danger {
  color: #ff6b6b;
}

.dropdown-item.text-danger:hover {
  background-color: rgba(255, 107, 107, 0.1);
}

/* Form controls */
.form-control {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: white;
  padding: 0.6rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  background-color: rgba(0, 0, 0, 0.5);
  border-color: rgba(228, 203, 134, 0.5);
  box-shadow: none;
  color: white;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-label {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* Form Select Styling */
.form-select {
  background-color: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: white;
  padding: 0.6rem 1rem;
  transition: all 0.3s ease;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba(228, 203, 134, 0.8)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  cursor: pointer;
}

.form-select:focus {
  background-color: rgba(0, 0, 0, 0.5);
  border-color: rgba(228, 203, 134, 0.5);
  box-shadow: none;
  color: white;
  outline: none;
}

/* Override browser default styling */
.form-select option {
  background-color: rgb(10, 10, 10);
  color: white;
  padding: 0.6rem 1rem;
}

/* Style the select when options are shown */
.form-select:focus option {
  background-color: rgb(10, 10, 10);
  color: white;
}

/* Style the highlighted/selected option */
.form-select option:checked,
.form-select option:hover,
.form-select option:focus,
.form-select option:active {
  background: rgba(228, 203, 134, 0.1) linear-gradient(0deg, rgba(228, 203, 134, 0.1) 0%, rgba(228, 203, 134, 0.1) 100%);
  color: var(--gold);
}

/* Ensure no blue highlight on Firefox */
.form-select:-moz-focusring {
  text-shadow: 0 0 0 #fff;
}

/* Remove default focus outline on Firefox */
.form-select:-moz-focusring option {
  outline: none !important;
  box-shadow: none !important;
}

/* Style for Webkit browsers */
.form-select option:hover {
  box-shadow: 0 0 10px 100px rgba(228, 203, 134, 0.1) inset;
}

/* Ensure consistent styling across browsers */
@-moz-document url-prefix() {
  .form-select option {
    background-color: rgb(10, 10, 10);
  }
  .form-select option:hover {
    background-color: rgba(228, 203, 134, 0.1);
    color: var(--gold);
  }
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
  .form-select option {
    background-color: rgb(10, 10, 10);
  }
  .form-select option:hover {
    background-color: rgba(228, 203, 134, 0.1);
    color: var(--gold);
  }
}

/* List groups */
.list-group {
  background-color: transparent;
  border-radius: 8px;
  overflow: visible;
}

.list-group-item {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  color: white;
  padding: 1.25rem;
  margin-bottom: 0.7rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Remove list-group-hover effects completely */
.list-group-hover .list-group-item {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 0.7rem;
}

.list-group-item-action {
  color: white;
}

.list-group-item-action:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.03);
}

/* Badge styling */
.badge {
  padding: 0.4em 0.7em;
  font-weight: 500;
  font-size: 0.75em;
  border-radius: 4px;
}

.badge.border {
  border-color: rgba(228, 203, 134, 0.3) !important;
}

.text-body {
  color: rgba(255, 255, 255, 0.7) !important;
}

/* Game cards styling */
.game-name {
  color: white;
  text-decoration: none;
  font-family: 'Cinzel', serif;
  transition: color 0.3s ease;
}

.game-name:hover {
  color: var(--gold);
  text-decoration: none;
}

.game-tag {
  font-family: var(--font-heiti);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.7rem;
}

.game-description {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 1rem;
}

/* User display */
.username-display {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  font-size: 1.1rem;
  padding: 0.5rem;
  color: var(--gold);
}

/* Empty state */
.empty-state-text {
  font-family: var(--font-heiti);
  font-weight: 300;
  font-size: 1.2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

/* Drop overlay */
#drop-overlay {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100 !important;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.drop-overlay-caption {
    margin-top: 45vh;
  color: var(--gold);
  text-align: center;
}

.drop-overlay-caption i {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.drop-overlay-caption p {
  font-size: 1.5rem;
  font-family: 'Cinzel', serif;
}

/* Modal styling */
.modal-content {
  background-color: rgba(20, 20, 20, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.modal-header {
  border-bottom: 1px solid rgba(228, 203, 134, 0.2);
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid rgba(228, 203, 134, 0.2);
  padding: 1.5rem;
}

.modal-title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
}

.btn-close {
  color: white;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.btn-close:hover {
  opacity: 1;
}

/* Media queries */
@media (max-width: 992px) {
  .container {
    padding: 1.5rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .list-group-item {
    padding: 1rem;
  }
  
  .card .card-body {
    padding: 1.25rem;
  }
}

@media (max-width: 576px) {
  h1 {
    font-size: 1.8rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .username-display {
    font-size: 1rem;
  }
  
  .empty-state-text {
    font-size: 1rem;
  }
}

/* RGMuseum Branding */
.rgmuseum-brand {
  text-align: center;
  margin: 2rem 0;
}

.rgmuseum-logo {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--gold);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 0.5rem;
}

.rgmuseum-subtitle {
  font-family: var(--font-heiti);
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 300;
}

/* Text colors */
.text-gold {
  color: var(--gold);
}

/* Game action buttons */
.game-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.game-action-btn {
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background-color: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none !important;
}

.game-action-btn i {
  margin-right: 0.3rem;
  font-size: 0.9rem;
}

.game-action-btn:hover, 
.game-action-btn:focus, 
.game-action-btn:active {
  background-color: rgba(228, 203, 134, 0.1);
  border-color: rgba(228, 203, 134, 0.4);
  color: var(--gold);
  text-decoration: none !important;
  outline: none;
  box-shadow: none;
}

.game-action-btn.play-btn {
  background-color: rgba(228, 203, 134, 0.1);
  border-color: rgba(228, 203, 134, 0.4);
  color: var(--gold);
  text-decoration: none !important;
}

.game-action-btn.play-btn:hover,
.game-action-btn.play-btn:focus,
.game-action-btn.play-btn:active {
  background-color: var(--gold);
  color: black;
  text-decoration: none !important;
  outline: none;
  box-shadow: none;
}

.game-action-btn.delete-btn {
  color: rgba(255, 107, 107, 0.8);
  border-color: rgba(255, 107, 107, 0.3);
  text-decoration: none !important;
}

.game-action-btn.delete-btn:hover,
.game-action-btn.delete-btn:focus,
.game-action-btn.delete-btn:active {
  background-color: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
  text-decoration: none !important;
  outline: none;
  box-shadow: none;
}

/* Form Check and Switch Styling */
.form-check-input {
  background-color: rgba(0, 0, 0, 0.3);
  border-color: rgba(228, 203, 134, 0.3);
}

.form-check-input:checked {
  background-color: var(--gold);
  border-color: var(--gold);
}

.form-check-input:focus {
  border-color: rgba(228, 203, 134, 0.5);
  box-shadow: 0 0 0 0.25rem rgba(228, 203, 134, 0.25);
}

.form-switch .form-check-input:focus {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba(228, 203, 134, 0.5)'/%3e%3c/svg%3e");
}

.form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Language-specific font styling */
.en, .english {
  font-family: 'Cinzel', serif !important;
}

.zh, .chinese, .zh-title {
  font-family: var(--font-heiti) !important;
  font-weight: 300 !important;
}

/* Override for specific zh elements */
h5.zh-title, h5.zh {
  font-family: var(--font-heiti) !important;
  font-weight: 300 !important;
}

span.zh, button.zh, label.zh, p.zh {
  font-family: var(--font-heiti) !important;
  font-weight: 300 !important;
}

.rgmuseum-logo.zh {
  font-family: var(--font-heiti) !important;
  font-weight: 300 !important;
}

/* Mixed language content */
.mixed-text {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.mixed-text .en {
  font-family: 'Cinzel', serif !important;
}

.mixed-text .zh {
  font-family: var(--font-heiti) !important;
}

/* Override for game names to always use Cinzel */
.game-name {
  font-family: 'Cinzel', serif !important;
}

/* Base body text - use Heiti by default */
body {
  font-family: var(--font-heiti);
  font-weight: 300;
}

/* Game list effects - remove all hover transforms */
.game-item, .abandoned-item {
  margin-bottom: 1rem;
}
