/*
 * SWORD-BH - Gerador de Flyer
 * Custom CSS for layout, premium RPG aesthetics, and responsive preview
 */

:root {
  --color-dark: #1a1512;
  --color-wood: #2c1a10;
  --color-gold: #cba052;
  --color-gold-hover: #e8c57a;
  --color-parchment: #f4e8d3;
  --color-text-dark: #3a2b22;
  --color-text-light: #e6dac3;
  --color-accent: #8b0000;
  
  --font-heading: 'Cinzel', serif;
  --font-body: 'Inter', sans-serif;
}

body {
  background-color: #2b1f17;
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../../assets/images/wood.png');
  background-attachment: fixed;
  background-size: cover;
  color: var(--color-text-light);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* Editor Workspace Layout */
.workspace-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

@media (max-width: 991.98px) {
  .workspace-container {
    flex-direction: column-reverse;
    height: auto;
    overflow: visible;
  }
}

/* Control Panel / Sidebar */
.editor-sidebar {
  width: 420px;
  background-color: rgba(26, 21, 18, 0.95);
  border-right: 2px solid var(--color-gold);
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
  z-index: 10;
}

@media (max-width: 991.98px) {
  .editor-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 2px solid var(--color-gold);
  }
}

.sidebar-header {
  padding: 15px 20px;
  background-color: var(--color-dark);
  border-bottom: 1px solid rgba(203, 160, 82, 0.3);
}

.sidebar-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}

.sidebar-footer {
  padding: 15px 20px;
  background-color: var(--color-dark);
  border-top: 1px solid rgba(203, 160, 82, 0.3);
}

/* Scrollbar styling for sidebar */
.sidebar-content::-webkit-scrollbar {
  width: 6px;
}
.sidebar-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
.sidebar-content::-webkit-scrollbar-thumb {
  background: var(--color-gold);
  border-radius: 3px;
}

/* Premium Tabs */
.nav-tabs-premium {
  border-bottom: 1px solid rgba(203, 160, 82, 0.3);
  margin-bottom: 20px;
}

.nav-tabs-premium .nav-link {
  color: var(--color-text-light);
  border: none;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  padding: 10px 15px;
  background: transparent;
  transition: all 0.3s;
  text-transform: uppercase;
}

.nav-tabs-premium .nav-link:hover {
  color: var(--color-gold);
}

.nav-tabs-premium .nav-link.active {
  color: var(--color-gold);
  border-bottom: 2px solid var(--color-gold);
  background: transparent;
}

/* Form Controls Custom Style matching Parchment Scroll Theme */
.parchment-input-group {
  margin-bottom: 18px;
}

.parchment-input-group label {
  font-family: var(--font-heading);
  color: var(--color-gold);
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 6px;
  display: block;
  letter-spacing: 0.5px;
}

.parchment-input {
  background-color: rgba(244, 232, 211, 0.9); /* Parchment color */
  border: 1px solid #8b6b4a;
  color: var(--color-text-dark);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.9rem;
  width: 100%;
  transition: all 0.2s;
}

.parchment-input:focus {
  background-color: #f4e8d3;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.2);
  outline: none;
}

textarea.parchment-input {
  resize: vertical;
}

/* Custom Checkbox/Switch and Range */
.form-check-input:checked {
  background-color: var(--color-accent);
  border-color: #5c0000;
}

.parchment-range {
  width: 100%;
  height: 6px;
  background: #5c3a21;
  outline: none;
  border-radius: 3px;
  -webkit-appearance: none;
}

.parchment-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-gold);
  cursor: pointer;
  border: 1px solid #a67c30;
  transition: transform 0.1s;
}

.parchment-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Interactive Preview Section */
.preview-pane {
  flex-grow: 1;
  background-color: rgba(15, 10, 8, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  position: relative;
  overflow: auto;
}

@media (max-width: 991.98px) {
  .preview-pane {
    height: 70vh;
    min-height: 400px;
  }
}

/* Scaling Container for responsiveness */
.preview-scale-wrapper {
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: inline-block;
  background-color: #111;
}

/* 
 * Strict Flyer Canvas (1080x1080 pixels)
 * All layout positioning matches the PPTX data.
 */
.flyer-canvas {
  width: 1080px;
  height: 1080px;
  position: relative;
  overflow: hidden;
  user-select: none;
  background-color: #000;
  box-sizing: border-box;
}

/* Flyer Elements */

/* Background Image Layer */
.flyer-bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1080px;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 1;
}

/* Dark Tint Overlay for Background */
.flyer-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 1080px;
  height: 1080px;
  background-color: #000;
  opacity: 0;
  z-index: 2;
}

/* Left Sidebar Panel Layer */
.flyer-sidebar-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 250px;
  height: 1080px;
  background-color: rgba(26, 21, 18, 0.8);
  backdrop-filter: blur(2px);
  border-right: 1px solid rgba(203, 160, 82, 0.2);
  z-index: 3;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* Left Column elements */
.flyer-header-logo {
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  margin-top: 10px;
  margin-bottom: 100px;
  text-transform: uppercase;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  width: 100%;
}

.flyer-section-title {
  color: var(--color-text-light);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: normal;
  text-align: center;
  margin-bottom: 10px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
  width: 100%;
}

.flyer-realizacao-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 60px;
}

.flyer-realizacao-logo {
  max-width: 170px;
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.8));
}

.flyer-apoio-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-grow: 1;
}

.flyer-apoio-logos-grid {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.flyer-apoio-item {
  max-width: 150px;
  max-height: 100px;
  object-fit: contain;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.8));
}

.flyer-apoio-text {
  font-family: var(--font-heading);
  color: var(--color-gold);
  font-size: 32px;
  font-weight: bold;
  text-align: center;
  text-shadow: 2px 2px 5px rgba(0,0,0,0.9);
  margin: 5px 0;
}

/* Right Content Column elements (positioned absolutely at the bottom right) */
.flyer-content-panel {
  position: absolute;
  bottom: 0;
  left: 250px;
  width: 830px;
  padding: 50px;
  box-sizing: border-box;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Optional dark background overlay for text readability */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.5) 60%, rgba(0,0,0,0) 100%);
}

.flyer-adventure-title {
  font-family: var(--font-heading);
  color: var(--color-gold);
  font-size: 72px;
  font-weight: bold;
  line-height: 1.1;
  margin-bottom: 20px;
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9), 0 0 15px rgba(203, 160, 82, 0.2);
  letter-spacing: 1px;
}

.flyer-details-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 30px;
  font-family: var(--font-body);
}

.flyer-details-line {
  color: #fff;
  font-size: 28px;
  font-weight: 500;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.flyer-details-label {
  color: var(--color-gold);
  font-weight: 600;
}

.flyer-date-time {
  font-family: var(--font-body);
  color: #fff;
  font-size: 30px;
  font-weight: bold;
  background-color: var(--color-accent);
  padding: 10px 20px;
  border-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0,0,0,0.5);
  border: 1px solid #5c0000;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

.flyer-credit {
  position: absolute;
  bottom: 15px;
  right: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-body);
  font-size: 15px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.9);
  z-index: 4;
}

.flyer-address {
  position: absolute;
  bottom: 15px;
  left: 270px;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-body);
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
  z-index: 4;
  max-width: 780px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-color: rgba(0, 0, 0, 0.6);
  padding: 6px 16px;
  border-radius: 4px;
  border: 1px solid rgba(203, 160, 82, 0.3);
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Customize list item UI inside the sidebar for managing logos */
.logo-list-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(203, 160, 82, 0.2);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-list-item img {
  height: 40px;
  width: 60px;
  object-fit: contain;
  background: rgba(0,0,0,0.3);
  border-radius: 2px;
  padding: 2px;
}

.logo-list-item .logo-text-preview {
  font-family: var(--font-heading);
  color: var(--color-gold);
  font-weight: bold;
  font-size: 1rem;
}

.logo-list-item .logo-info {
  flex-grow: 1;
  padding-left: 10px;
  font-size: 0.8rem;
}

.logo-list-item-buttons {
  display: flex;
  gap: 5px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--color-text-light);
  font-size: 0.9rem;
  padding: 2px 6px;
  border-radius: 3px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-gold);
}

.btn-icon.text-danger:hover {
  background: rgba(139, 0, 0, 0.2);
  color: #ff4d4d;
}

/* Accordion modifications for premium look */
.accordion-premium {
  --bs-accordion-bg: transparent;
  --bs-accordion-color: var(--color-text-light);
  --bs-accordion-btn-color: var(--color-gold);
  --bs-accordion-btn-bg: rgba(26, 21, 18, 0.6);
  --bs-accordion-active-color: var(--color-gold-hover);
  --bs-accordion-active-bg: rgba(26, 21, 18, 0.9);
  --bs-accordion-border-color: rgba(203, 160, 82, 0.2);
  --bs-accordion-btn-focus-box-shadow: none;
}

.accordion-premium .accordion-button {
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(203, 160, 82, 0.2);
}

.accordion-premium .accordion-button:not(.collapsed) {
  box-shadow: none;
}

.accordion-premium .accordion-body {
  padding: 15px 5px;
}

/* Custom Color Picker Styling */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.color-picker-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.color-picker-input::-webkit-color-swatch {
  border-radius: 4px;
  border: 1px solid #8b6b4a;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

.color-picker-hex {
  font-family: monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  flex-grow: 1;
}

/* Zoom Slider HUD */
.preview-zoom-hud {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(26, 21, 18, 0.85);
  border: 1px solid var(--color-gold);
  border-radius: 20px;
  padding: 6px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.preview-zoom-hud span {
  font-size: 0.8rem;
  color: var(--color-text-light);
  min-width: 45px;
  text-align: right;
  font-weight: 600;
}

/* Premium Gold Buttons */
.btn-gold {
  background: linear-gradient(135deg, #cba052 0%, #e8c57a 50%, #cba052 100%);
  border: 1px solid #8b6b4a;
  color: #1a1512 !important;
  font-family: var(--font-heading);
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn-gold:hover, .btn-gold:focus {
  background: linear-gradient(135deg, #e8c57a 0%, #ffffff 50%, #e8c57a 100%) !important;
  color: #000 !important;
  box-shadow: 0 0 15px rgba(232, 197, 122, 0.8) !important;
  border-color: #cba052;
  transform: translateY(-1px);
}

.btn-gold:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}
