/* Guestbook Styles - Matching 4-PLAY FM Theme */
:root {
  --gb-primary-bg: #1c1c1c;
  --gb-primary-text: #bdbdbd;
  --gb-accent-color: #027de7;
  --gb-accent-gradient: linear-gradient(90deg, #027de7, #00d4ff);
  --gb-card-bg: rgba(28, 28, 28, 0.95);
  --gb-border: rgba(255, 255, 255, 0.1);
  --gb-entry-bg: rgba(255, 255, 255, 0.85);
  --gb-entry-text: #333333;
  --gb-entry-border: rgba(2, 125, 231, 0.2);
  /* Background image settings */
  --gb-bg-image: url('../img/gb-background.jpg'); /* Change path here */
  --gb-bg-opacity: 0.15; /* Change opacity here (0.0 to 1.0) */
}

body {
  background: #f5f5f5;
  margin: 0;
  padding: 0;
  color: #333333;
}

.guestbook-container {
  max-width: 900px; /* Increased from 700px - wider on desktop */
  margin: 0 auto;
  padding: 25px 20px;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: transparent;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center all content including entries and button */
}

/* Ensure all content is above background */
.guestbook-container > * {
  position: relative;
  z-index: 1;
}

.gb-title {
  text-align: center;
  background: var(--gb-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 25px;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 3px;
  font-size: 22px;
  font-weight: 600;
  text-transform: uppercase;
  position: relative;
}

.gb-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--gb-accent-gradient);
  border-radius: 2px;
}

.gb-form-container {
  background: rgba(255, 255, 255, 0.85);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(2, 125, 231, 0.2);
  position: relative;
  width: 100%; /* Full width to match entries */
  box-sizing: border-box; /* Include padding in width */
}

.gb-form-group {
  margin-bottom: 15px;
  position: relative;
}

.gb-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
  color: #333333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gb-form-group input,
.gb-form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-family: 'Lato', sans-serif;
  background: rgba(255, 255, 255, 0.95);
  color: #333333;
}

.gb-form-group input::placeholder,
.gb-form-group textarea::placeholder {
  color: #999;
}

.gb-form-group input:focus,
.gb-form-group textarea:focus {
  outline: none;
  border-color: var(--gb-accent-color);
  box-shadow: 0 0 0 2px rgba(2, 125, 231, 0.2);
  background: rgba(255, 255, 255, 1.0);
}

.gb-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

/* Emoji Picker Styles */
.emoji-picker-container {
  padding: 0.8rem;
  background: #0a0f14;
  border: 1px solid #1e2a38;
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1000;
  margin-top: 0.5rem;
}

.emoji-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 1.3em;
  line-height: 1.5;
}

.emoji-item {
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
  user-select: none;
  -webkit-user-select: none;
  display: inline-block;
}

.emoji-item:hover {
  background: rgba(2, 125, 231, 0.1);
}

.emoji-item:active {
  background: rgba(2, 125, 231, 0.2);
  transform: scale(0.95);
}

/* Custom Scrollbar for Emoji Picker */
.emoji-picker-container::-webkit-scrollbar {
  width: 6px;
}

.emoji-picker-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.emoji-picker-container::-webkit-scrollbar-thumb {
  background: var(--gb-accent-color);
  border-radius: 3px;
}

.emoji-picker-container::-webkit-scrollbar-thumb:hover {
  background: #00d4ff;
}

/* Custom Scrollbar for Dropdown */
.emoji-dropdown-menu::-webkit-scrollbar {
  width: 6px;
}

.emoji-dropdown-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.emoji-dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--gb-accent-color);
  border-radius: 3px;
}

.emoji-dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: #00d4ff;
}

.gb-submit-btn {
  width: 100%;
  padding: 10px 20px;
  background: var(--gb-accent-gradient);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(2, 125, 231, 0.3);
}

.gb-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(2, 125, 231, 0.4);
}

.gb-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.gb-message {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  display: none;
}

.gb-message.success {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.3);
  display: block;
}

.gb-message.error {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.3);
  display: block;
}

/* Entries - White Background with Site Colors */
.gb-entries {
  margin-top: 30px;
}

.gb-entry {
  background: var(--gb-entry-bg);
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.gb-entry::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gb-accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gb-entry:hover {
  box-shadow: 0 4px 20px rgba(2, 125, 231, 0.15);
  transform: translateY(-2px);
}

.gb-entry:hover::before {
  opacity: 1;
}

.gb-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(2, 125, 231, 0.1);
  flex-wrap: wrap;
  gap: 8px;
}

.gb-entry-name {
  font-weight: 600;
  color: var(--gb-accent-color);
  font-size: 16px;
  font-family: 'Montserrat', sans-serif;
}

.gb-entry-location {
  color: #666;
  font-size: 13px;
  margin-left: 8px;
  font-style: italic;
}

.gb-entry-date {
  color: #999;
  font-size: 12px;
}

.gb-entry-message {
  color: var(--gb-entry-text);
  line-height: 1.7;
  font-size: 14px;
  margin-top: 10px;
}

.gb-entry-emoji {
  font-size: 20px;
  margin-right: 8px;
}

.gb-entry-gif {
  max-width: 150px;
  margin-top: 10px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Admin Response */
.gb-entry-response {
  margin-top: 15px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(2, 125, 231, 0.05) 0%, rgba(0, 212, 255, 0.05) 100%);
  border-left: 3px solid var(--gb-accent-color);
  border-radius: 6px;
}

.gb-entry-response-header {
  font-weight: 600;
  color: var(--gb-accent-color);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-family: 'Montserrat', sans-serif;
}

.gb-entry-response-text {
  color: var(--gb-entry-text);
  font-size: 13px;
  line-height: 1.6;
}

/* Pagination - Dark Theme */
.gb-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.gb-pagination button {
  padding: 6px 12px;
  border: 1px solid var(--gb-accent-color);
  background: var(--gb-card-bg);
  color: var(--gb-accent-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 12px;
}

.gb-pagination button:hover:not(:disabled) {
  background: var(--gb-accent-gradient);
  color: #fff;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(2, 125, 231, 0.3);
}

.gb-pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gb-pagination .active {
  background: var(--gb-accent-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(2, 125, 231, 0.3);
}

/* Math CAPTCHA Styles */
.gb-form-group label[for="gbCaptcha"] {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  text-transform: none;
}

#captchaQuestion {
  font-weight: 500;
  color: #333333;
  font-size: 13px;
}

.refresh-captcha-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  opacity: 0.6;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border-radius: 3px;
  line-height: 1;
  color: #333333;
}

.refresh-captcha-btn:hover {
  opacity: 1;
  transform: rotate(180deg);
  color: var(--gb-accent-color);
}

.refresh-captcha-btn:active {
  transform: rotate(180deg) scale(0.95);
}

#gbCaptcha {
  width: 120px;
  max-width: 100%;
}

/* Toggle Button Styles */
.gb-toggle-btn {
  margin: 20px 0;
  width: auto; /* Changed from 100% to auto - button width based on content */
  display: flex;
  justify-content: center; /* Center the button */
}

.gb-add-message-btn {
  background: var(--gb-accent-gradient);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Montserrat', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(2, 125, 231, 0.3);
  width: auto; /* Changed from 100% to auto - button width based on content */
  box-sizing: border-box;
}

.gb-add-message-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(2, 125, 231, 0.4);
}

.gb-back-btn {
  background: transparent;
  border: 1px solid #ddd;
  color: #333;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  font-family: 'Lato', sans-serif;
}

.gb-back-btn:hover {
  background: #f5f5f5;
  border-color: var(--gb-accent-color);
  color: var(--gb-accent-color);
}

.gb-entries-container {
  height: 600px; /* Fixed height to show ~5 entries */
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%; /* Full width of container to align with button */
  box-sizing: border-box; /* Include padding in width calculation */
  padding-right: 0; /* Remove padding to account for scrollbar */
}

/* Custom scrollbar for entries container */
.gb-entries-container::-webkit-scrollbar {
  width: 8px;
}

.gb-entries-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  margin-right: 2px; /* Space from edge */
}

.gb-entries-container::-webkit-scrollbar-thumb {
  background: var(--gb-accent-color);
  border-radius: 4px;
}

.gb-entries-container::-webkit-scrollbar-thumb:hover {
  background: #00d4ff;
}

.gb-entries {
  padding-right: 0; /* Remove extra padding */
  width: 100%; /* Full width */
  box-sizing: border-box;
}

/* Responsive */
@media (max-width: 768px) {
  .guestbook-container {
    padding: 15px 0; /* Minimal side padding for full width */
    max-width: 100%; /* Use full width */
    width: 100%; /* Full width on mobile */
    align-items: center; /* Center entries and button on mobile */
  }
  
  .gb-entries-container {
    width: 100%; /* Full width of container */
    margin: 0 auto; /* Center it */
    padding-right: 0; /* No padding for scrollbar */
  }
  
  .gb-title {
    font-size: 20px;
  }
  
  .gb-entry {
    padding: 18px 15px; /* Slightly reduced but better spacing */
    margin-bottom: 12px;
    width: 100%; /* Full width */
    box-sizing: border-box;
  }
  
  .gb-entry-name {
    font-size: 16px; /* Increased from 14px */
    font-weight: 600;
  }
  
  .gb-entry-message {
    font-size: 15px; /* Increased from 13px */
    line-height: 1.7;
  }
  
  .gb-entry-date {
    font-size: 13px; /* Slightly larger */
  }
  
  .gb-entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px; /* Better spacing */
  }
  
  .gb-form-container {
    padding: 12px;
    width: 100%; /* Ensure full width on mobile */
    box-sizing: border-box;
  }
  
  .gb-form-group input,
  .gb-form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 10px;
  }
  
  .gb-entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  
  .gb-entry-name {
    font-size: 14px;
  }
  
  .gb-entry-message {
    font-size: 13px;
  }
  
  #gbCaptcha {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .gb-form-group label[for="gbCaptcha"] {
    gap: 6px;
    font-size: 12px;
  }
  
  .emoji-picker-container {
    max-height: 160px;
    padding: 0.6rem;
  }
  
  .emoji-picker-grid {
    gap: 0.3rem;
    font-size: 1.2em;
  }
  
  .emoji-item {
    padding: 6px;
    min-width: 32px;
    min-height: 32px;
  }
  
  /* Make emoji button more touch-friendly on mobile */
  #emojiBtn {
    padding: 6px 10px !important;
    font-size: 1.3em !important;
    min-width: 38px;
    min-height: 38px;
  }
  
  .gb-submit-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .gb-entries-container {
    height: 500px;
    max-height: 500px;
  }
}

@media (max-width: 576px) {
  .guestbook-container {
    padding: 12px 0; /* Minimal side padding for full width */
    width: 100%; /* Full width on mobile */
    align-items: center; /* Center entries and button on small mobile */
  }
  
  .gb-entries-container {
    width: 100%; /* Full width of container */
    margin: 0 auto; /* Center it */
    padding-right: 0; /* No padding for scrollbar */
    height: 300px; /* Reduced to show ~3 entries */
    max-height: 300px;
    /* Hide scrollbar on mobile but keep scrolling */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }
  
  .gb-entries-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari - hide scrollbar on mobile */
  }
  
  .gb-entry {
    padding: 16px 12px; /* Optimized padding */
    margin-bottom: 10px;
    border-radius: 6px;
    width: 100%; /* Full width */
    box-sizing: border-box;
  }
  
  .gb-entry-name {
    font-size: 15px;
    margin-bottom: 8px;
    font-weight: 600;
  }
  
  .gb-entry-message {
    font-size: 14px;
    line-height: 1.7;
  }
  
  .gb-entry-date {
    font-size: 12px;
  }
  
  .gb-form-container {
    padding: 10px;
    width: 100%; /* Ensure full width on small mobile */
    box-sizing: border-box;
  }
  
  .emoji-picker-container {
    max-height: 140px;
    padding: 0.5rem;
  }
  
  .emoji-picker-grid {
    gap: 0.25rem;
    font-size: 1.1em;
  }
  
  .emoji-item {
    padding: 5px;
    min-width: 30px;
    min-height: 30px;
  }
  
  .gb-form-group label[for="gbCaptcha"] {
    gap: 4px;
  }
  
  #captchaQuestion {
    font-size: 12px;
  }
  
  .refresh-captcha-btn {
    font-size: 12px;
    padding: 3px 5px;
  }
}
