/* css/hat-renderer.css */
/* Styles for the hat rendering system */

/* ===================================================== */
/* HAT CONTAINER AND WRAPPER STYLES */
/* ===================================================== */

.hat-image-container {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
  }
  
  .hat-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 100%;
  }
  
  /* Wrapper styles for actual image rendering */
  .hat-wrapper--actual {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
  }
  
  /* Wrapper styles for template with text overlay */
  .hat-wrapper--template {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 100%;
  }
  
  .hat-base-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    background: #f5f5f5;
  }
  
  /* Base image styles for actual hat images */
  .hat-base-image--actual {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  
  /* Base image styles for template images */
  .hat-base-image--template {
    width: 100%;
    height: auto;
    display: block;
  }
  
/* ===================================================== */
/* HAT TEXT OVERLAY STYLES */
/* ===================================================== */

  .hat-text-overlay {
    position: absolute;
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* Typography - matches JavaScript config.textStyles */
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.2;
    
    /* Effects */
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    
    /* Layout - matches JavaScript config.positioning */
    max-width: 70%; /* Updated to match JS config (was 75%) */
    word-wrap: break-word;
    white-space: nowrap;
    
    /* Interaction */
    pointer-events: none;
    user-select: none;
    z-index: 10;
    
    /* Ensure text is readable */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* Base text overlay class for template rendering */
  .hat-text-overlay--template {
    /* All base styles inherited from .hat-text-overlay */
    /* Additional template-specific styles can go here */
  }
  
  /* Text overlay animation class */
  .hat-text-overlay--animated {
    animation: hatTextFadeIn 0.5s ease-out;
  }
  
  /* Text overlay multiline mode */
  .hat-text-overlay--multiline {
    white-space: normal;
    word-break: normal;
  }
  
  /* Text overlay single line mode */
  .hat-text-overlay--single-line {
    white-space: nowrap;
  }
  
  /* Responsive adjustments */
  @media (max-width: 480px) {
    .hat-text-overlay {
      font-size: 14px;
      max-width: 75%;
    }
  }
  
  @media (min-width: 768px) {
    .hat-text-overlay {
      font-size: 20px;
    }
  }
  
  /* Loading state */
  .hat-image-container[data-rendered="false"] .hat-wrapper {
    opacity: 0.7;
  }
  
  .hat-image-container[data-rendered="true"] .hat-wrapper {
    opacity: 1;
    transition: opacity 0.3s ease;
  }
  
  /* Special text effects for different categories */
  .hat-image-container[data-category="shock"] .hat-text-overlay {
    color: #e84545;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.9);
  }
  
  .hat-image-container[data-category="silly"] .hat-text-overlay {
    color: #2b7de9;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
  }
  
  .hat-image-container[data-category="irony"] .hat-text-overlay {
    color: #1a1a1a;
    font-style: italic;
  }
  
  .hat-image-container[data-category="specific"] .hat-text-overlay {
    color: #5f6368;
    font-weight: 900;
  }
  
  .hat-image-container[data-category="self_deprecating"] .hat-text-overlay {
    color: #6b7280;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.7);
  }
  
  .hat-image-container[data-category="cocky"] .hat-text-overlay {
    color: #dc2626;
    font-weight: 900;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.9);
    transform: translate(-50%, -50%) scale(1.05);
  }
  
  .hat-image-container[data-category="spicy"] .hat-text-overlay {
    color: #ea580c;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(255,255,255,0.8);
    animation: spicyPulse 2s ease-in-out infinite alternate;
  }
  
  /* Animation for text appearance */
  @keyframes hatTextFadeIn {
    from {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.8);
    }
    to {
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }
  }
  
  /* Animation for spicy category */
  @keyframes spicyPulse {
    from {
      text-shadow: 2px 2px 4px rgba(255,255,255,0.8);
    }
    to {
      text-shadow: 2px 2px 8px rgba(255,165,0,0.6);
    }
  }
  
  .hat-text-overlay {
    animation: hatTextFadeIn 0.5s ease-out;
  }
