/**
 * YTM Creative Generator - Styles
 * Dark theme with 3-column layout
 */

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #000000;
  color: #ffffff;
  overflow: hidden;
  height: 100vh;
}

/* ============================================================================
   APP CONTAINER & LAYOUT
   ============================================================================ */

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ============================================================================
   TOP HEADER
   ============================================================================ */

.app-header {
  background: #000000;
  border-bottom: 1px solid #3a3a3a;
  padding: 12px 20px;
  flex-shrink: 0;
}

.header-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.logo-icon {
  font-size: 24px;
  color: #FF0000;
  font-weight: bold;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-self: end;
}

/* Status Indicator (Center of Header) */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px 16px;
  justify-self: center;
  min-width: 300px;
  transition: all 0.3s ease;
}

.status-indicator.hidden {
  display: none;
}

.status-indicator.processing {
  border-color: #1a73e8;
  background: rgba(26, 115, 232, 0.1);
}

.status-indicator.generating {
  border-color: #FF6600;
  background: rgba(255, 102, 0, 0.1);
}

.status-indicator.complete {
  border-color: #34a853;
  background: rgba(52, 168, 83, 0.1);
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.status-indicator.generating .spinner-small {
  border-top-color: #FF6600;
}

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

.status-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.status-message {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.status-time {
  font-size: 11px;
  color: #999;
}

.cancel-job-btn {
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.3);
  color: #ff4444;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
}

.cancel-job-btn:hover {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.5);
  color: #ff6666;
}

.cancel-job-btn:active {
  transform: scale(0.95);
}

.cancel-icon {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.open-agents-btn {
  background: #FF0000;
  color: white;
  border: 2px solid #FF0000;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.open-agents-btn:hover {
  background: #CC0000;
  border-color: #CC0000;
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
  transform: translateY(-2px);
}

.open-agents-btn .btn-icon {
  font-size: 14px;
}

.open-agents-btn .btn-text {
  font-size: 13px;
}

/* ============================================================================
   MAIN LAYOUT (3 COLUMNS)
   ============================================================================ */

.main-layout {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 0;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ============================================================================
   LEFT SIDEBAR - CONTROL PANEL
   ============================================================================ */

.left-sidebar {
  background: #2a2a2a;
  border-right: 1px solid #3a3a3a;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.control-panel {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

.panel-title {
  font-size: 14px;
  font-weight: 600;
  color: #cccccc;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #3a3a3a;
}

.button-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.button-section.bottom-actions {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #3a3a3a;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: #999999;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

/* Control Buttons */
.control-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.control-btn:hover:not(:disabled) {
  background: #333333;
  border-color: #FF0000;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.control-btn.active {
  border-color: #FF0000;
  background: rgba(255, 0, 0, 0.1);
}

.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.btn-text {
  flex: 1;
  text-align: left;
}

/* Aspect Ratio Selector */
.aspect-select {
  width: 100%;
  padding: 12px 14px;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23ffffff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.aspect-select:hover {
  background-color: #333333;
  border-color: #4a4a4a;
}

.aspect-select:focus {
  outline: none;
  border-color: #FF0000;
}

/* ============================================================================
   CENTER CONTENT - MAIN LIGHTBOX
   ============================================================================ */

.center-content {
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  overflow: auto;
  position: relative;
}

.main-lightbox {
  background: #1a1a1a;
  border: 2px solid #3a3a3a;
  border-radius: 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  max-width: 100%;
  max-height: 100%;
}

/* Aspect ratio containers */
.main-lightbox[data-ratio="9:16"] {
  aspect-ratio: 9 / 16;
  width: auto;
  height: 90%;
}

.main-lightbox[data-ratio="16:9"] {
  aspect-ratio: 16 / 9;
  width: 90%;
  height: auto;
}

.main-lightbox[data-ratio="1:1"] {
  aspect-ratio: 1 / 1;
  width: auto;
  height: 80%;
}

.main-lightbox[data-ratio="4:3"] {
  aspect-ratio: 4 / 3;
  width: 85%;
  height: auto;
}

/* Empty state */
.lightbox-empty {
  text-align: center;
  padding: 40px;
  color: #666666;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: #999999;
  margin-bottom: 12px;
}

.empty-ratio {
  font-size: 14px;
  color: #666666;
  margin-bottom: 8px;
}

.empty-instruction {
  font-size: 13px;
  color: #555555;
}

/* Lightbox with content */
.lightbox-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-content.hidden {
  display: none;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-content video {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

/* Loading state */
.lightbox-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #999999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #3a3a3a;
  border-top-color: #FF0000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 14px;
  color: #666666;
}

/* ============================================================================
   RIGHT SIDEBAR - GALLERY VIEW
   ============================================================================ */

.right-sidebar {
  background: #2a2a2a;
  border-left: 1px solid #3a3a3a;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gallery-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gallery-header {
  padding: 16px;
  border-bottom: 1px solid #3a3a3a;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.gallery-icon {
  font-size: 18px;
}

.gallery-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  align-content: start;
}

.gallery-item {
  aspect-ratio: 1 / 1;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item:hover {
  border-color: #FF0000;
  transform: scale(1.05);
}

.gallery-item.selected {
  border: 2px solid #FF0000;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gallery Checkbox */
.gallery-checkbox {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 10;
  appearance: none;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.gallery-checkbox:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: #FF0000;
}

.gallery-checkbox:checked {
  background: #FF0000;
  border-color: #FF0000;
}

.gallery-checkbox:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.gallery-item-empty {
  font-size: 11px;
  color: #555555;
  text-align: center;
}

.gallery-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(255, 0, 0, 0.8);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.gallery-item:hover .gallery-delete-btn {
  opacity: 1;
}

.gallery-delete-btn:hover {
  background: #FF0000;
  transform: scale(1.1);
}

.gallery-footer {
  padding: 16px;
  border-top: 1px solid #3a3a3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

/* Send to Template Stamper Button */
.send-to-stamper-btn {
  flex: 1;
  background: linear-gradient(135deg, #FF0000, #CC0000);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.send-to-stamper-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.send-to-stamper-btn:active {
  transform: translateY(0);
}

.send-to-stamper-btn .btn-icon {
  font-size: 16px;
}

.send-to-stamper-btn:disabled {
  background: linear-gradient(135deg, #666666, #555555);
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.send-to-stamper-btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

.help-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  color: #999999;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.help-btn:hover {
  background: #333333;
  border-color: #FF0000;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

/* Help Modal */
.help-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.help-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.help-modal-content {
  position: relative;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 16px;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.help-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #3a3a3a;
  background: #2a2a2a;
}

.help-modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
}

.help-close-btn {
  background: none;
  border: none;
  color: #999999;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.help-close-btn:hover {
  color: #FF0000;
}

.help-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(85vh - 70px);
}

.help-section {
  margin-bottom: 24px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #FF0000;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 12px 0;
}

.help-item {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: #2a2a2a;
  border-radius: 8px;
}

.help-item:last-child {
  margin-bottom: 0;
}

.help-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.help-text {
  flex: 1;
}

.help-text strong {
  display: block;
  color: #ffffff;
  font-size: 14px;
  margin-bottom: 4px;
}

.help-text p {
  margin: 0;
  color: #cccccc;
  font-size: 13px;
  line-height: 1.5;
}

.help-text ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
  color: #cccccc;
  font-size: 13px;
  line-height: 1.6;
}

.help-text code {
  background: #333333;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  color: #FF6666;
}

/* ============================================================================
   BOTTOM PROMPT AREA
   ============================================================================ */

.prompt-container {
  background: #2a2a2a;
  border-top: 1px solid #3a3a3a;
  padding: 20px;
  flex-shrink: 0;
}

.prompt-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #999999;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prompt-input-wrapper {
  position: relative;
  width: 100%;
}

.prompt-input {
  width: 100%;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 60px;
  transition: all 0.2s ease;
}

.prompt-input:focus {
  outline: none;
  border-color: #FF0000;
  background: #222222;
}

.prompt-input::placeholder {
  color: #555555;
}

/* Custom resize handle on top-right */
.resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 20px;
  height: 20px;
  cursor: ns-resize;
  background: #FF0000;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
  border-radius: 0 6px 0 0;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.resize-handle:hover {
  opacity: 1;
}

.resize-handle::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 3px;
  width: 6px;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 1px;
  box-shadow: 0 3px 0 rgba(255, 255, 255, 0.8);
}

/* ============================================================================
   SCROLLBAR STYLING
   ============================================================================ */

.left-sidebar::-webkit-scrollbar,
.gallery-grid::-webkit-scrollbar,
.center-content::-webkit-scrollbar {
  width: 8px;
}

.left-sidebar::-webkit-scrollbar-track,
.gallery-grid::-webkit-scrollbar-track,
.center-content::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.left-sidebar::-webkit-scrollbar-thumb,
.gallery-grid::-webkit-scrollbar-thumb,
.center-content::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 4px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover,
.gallery-grid::-webkit-scrollbar-thumb:hover,
.center-content::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

/* ============================================================================
   MOBILE RESPONSIVE
   ============================================================================ */

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 200px 1fr 240px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .main-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .left-sidebar {
    border-right: none;
    border-bottom: 1px solid #3a3a3a;
    overflow-x: auto;
    overflow-y: visible;
  }

  .control-panel {
    flex-direction: row;
    gap: 12px;
    padding: 16px;
  }

  .button-section {
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
  }

  .button-section.bottom-actions {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  .control-btn {
    flex: 0 0 auto;
    min-width: 120px;
  }

  .aspect-select {
    min-width: 150px;
  }

  .right-sidebar {
    border-left: none;
    border-top: 1px solid #3a3a3a;
    max-height: 200px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    padding: 12px;
    gap: 8px;
  }

  .center-content {
    padding: 20px;
  }

  .main-lightbox[data-ratio="9:16"] {
    height: 85%;
  }

  .main-lightbox[data-ratio="16:9"] {
    width: 95%;
  }

  .main-lightbox[data-ratio="1:1"] {
    height: 75%;
  }

  .main-lightbox[data-ratio="4:3"] {
    width: 95%;
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 14px;
  }

  .control-btn {
    min-width: 100px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .section-label {
    font-size: 10px;
  }

  .prompt-container {
    padding: 16px;
  }

  .prompt-input {
    font-size: 13px;
    padding: 10px 12px;
  }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.slide-up {
  animation: slideUp 0.3s ease;
}

/* ============================================================================
   MCP BRIDGE - IMPORT TOAST NOTIFICATION
   ============================================================================ */

.import-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #1a1a1a;
  border: 2px solid #FF0000;
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
  opacity: 0;
  transition: all 0.3s ease;
}

.import-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  width: 32px;
  height: 32px;
  background: #FF0000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  color: white;
}

.toast-message {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}
/* Country Tabs Styling */
.country-tabs {
  display: flex;
  gap: 5px;
  padding: 10px 15px 5px 15px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.country-tab {
  flex: 1;
  padding: 8px 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.country-tab.active {
  background: #FF0000;
  border-color: #FF0000;
  color: white;
  font-weight: 600;
}

/* Upload Button in Gallery Header */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 0, 0, 0.15);
  border: 1px solid rgba(255, 0, 0, 0.3);
  border-radius: 6px;
  color: #FF0000;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.upload-btn:hover {
  background: rgba(255, 0, 0, 0.25);
  border-color: #FF0000;
}

.upload-btn .btn-icon {
  font-size: 14px;
}

.upload-btn .btn-text {
  font-weight: 500;
}

/* Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-content {
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
}

.modal-content h3 {
  color: white;
  font-size: 20px;
  margin: 0 0 10px 0;
  font-weight: 600;
}

.modal-content p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 0 0 20px 0;
}

.country-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.country-select-btn,
.country-upload-btn {
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.country-select-btn:hover,
.country-upload-btn:hover {
  background: rgba(255, 0, 0, 0.15);
  border-color: #FF0000;
  transform: translateY(-2px);
}

.modal-cancel-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

/* Template Stamper Transfer Modal */
.transfer-assets-list {
  max-height: 300px;
  overflow-y: auto;
  margin: 20px 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.transfer-asset-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.transfer-asset-item:last-child {
  margin-bottom: 0;
}

.transfer-asset-item .asset-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.transfer-asset-item .asset-info {
  font-size: 12px;
  font-weight: 600;
  color: #FF0000;
  flex-shrink: 0;
}

.transfer-asset-item .asset-prompt {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-confirm-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #FF0000, #CC0000);
  border: 2px solid #FF0000;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}

.modal-confirm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
}

.modal-confirm-btn:active {
  transform: translateY(0);
}

.modal-confirm-btn:disabled {
  background: #666;
  border-color: #666;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#uploadFileInput {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  font-size: 14px;
}

/* ============================================================================
   INITIAL COUNTRY SELECTION MODAL
   ============================================================================ */

.initial-modal {
  background: rgba(0, 0, 0, 0.95) !important;
  backdrop-filter: blur(10px);
  z-index: 20000 !important;
}

.initial-country-content {
  max-width: 600px !important;
  text-align: center;
  padding: 40px !important;
}

.initial-country-content h2 {
  color: white;
  font-size: 28px;
  font-weight: 700;
}

.country-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 30px;
}

.country-selection-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 30px 20px;
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(255, 0, 0, 0.05));
  border: 2px solid rgba(255, 0, 0, 0.3);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.country-selection-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 0, 0, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.country-selection-btn:hover::before {
  opacity: 1;
}

.country-selection-btn:hover {
  border-color: rgba(255, 0, 0, 0.6);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 0, 0, 0.3);
}

.country-flag-large {
  font-size: 64px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.country-name {
  font-size: 20px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.5px;
}

/* ============================================================================
   COUNTRY BANNER
   ============================================================================ */

.country-banner {
  position: sticky;
  top: 0;
  z-index: 999;
  padding: 12px 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  border-bottom: 2px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.country-banner:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  transform: translateY(-1px);
}

.country-change-hint {
  opacity: 0.6;
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
}

.country-banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.country-label {
  opacity: 0.8;
  font-weight: 400;
  font-size: 14px;
}

.country-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.country-flag {
  font-size: 24px;
}

/* Country-specific colors */
.country-banner.korea {
  background: linear-gradient(135deg, #cd2e3a 0%, #b02030 100%);
}

.country-banner.japan {
  background: linear-gradient(135deg, #bc002d 0%, #9c0025 100%);
}

.country-banner.india {
  background: linear-gradient(135deg, #ff9933 0%, #e68a2e 100%);
}

.country-banner.indonesia {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
}
