// Modern Roll Dialog Styling
// Matches the new chat message card design

.prismrpg-roll-dialog-modern {
  font-family: var(--font-primary);
  
  // Header section
  .dialog-header {
    background: linear-gradient(135deg, rgba(33, 33, 33, 0.95) 0%, rgba(66, 66, 66, 0.95) 100%);
    border-bottom: 2px solid #d4af37;
    padding: 8px 10px;
    margin: -8px -8px 8px -8px;
    border-radius: 4px 4px 0 0;

    .character-info {
      display: flex;
      flex-direction: column;
      gap: 4px;

      .character-name {
        font-size: 1em;
        font-weight: bold;
        color: #d4af37;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
      }

      .item-name {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 0.9em;
        color: #e0e0e0;

        i {
          color: #d4af37;
          font-size: 0.85em;
        }

        &.weapon i {
          color: #f44336;
        }

        &.spell i {
          color: #9c27b0;
        }
      }
    }
  }

  // Content area
  .dialog-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  // Section styling
  .option-section {
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 6px 8px;

    &.weapon-section {
      border-left: 3px solid #f44336;
    }

    &.spell-section {
      border-left: 3px solid #9c27b0;
    }

    .section-title {
      display: flex;
      align-items: center;
      gap: 4px;
      font-weight: bold;
      font-size: 0.9em;
      color: var(--color-dark-1);
      margin-bottom: 6px;
      padding-bottom: 4px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.15);

      i {
        color: #d4af37;
        font-size: 0.85em;
      }
    }
  }

  // Info displays (ranges, spell stats)
  .info-display {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
    margin-bottom: 6px;
    font-size: 0.8em;
    color: #666;

    i {
      color: #4caf50;
      font-size: 0.85em;
    }

    .info-text {
      flex: 1;
    }
  }

  // Spell info badges (like in chat)
  .spell-info-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;

    .info-badge {
      display: flex;
      align-items: center;
      gap: 3px;
      padding: 3px 6px;
      border-radius: 3px;
      font-size: 0.75em;
      font-weight: 500;

      i {
        font-size: 0.85em;
      }

      &.characteristic {
        background: rgba(103, 58, 183, 0.2);
        border: 1px solid rgba(103, 58, 183, 0.4);
        color: #673ab7;
        i { color: #673ab7; }
      }

      &.mana {
        background: rgba(33, 150, 243, 0.2);
        border: 1px solid rgba(33, 150, 243, 0.4);
        color: #2196f3;
        i { color: #2196f3; }
      }

      &.apc {
        background: rgba(255, 193, 7, 0.2);
        border: 1px solid rgba(255, 193, 7, 0.4);
        color: #ffc107;
        i { color: #ffc107; }
      }

      &.upkeep {
        background: rgba(156, 39, 176, 0.2);
        border: 1px solid rgba(156, 39, 176, 0.4);
        color: #9c27b0;
        i { color: #9c27b0; }
      }
    }
  }

  // Option rows (label + control)
  .option-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;

    &:last-child {
      margin-bottom: 0;
    }

    label {
      font-size: 0.85em;
      font-weight: 500;
      color: var(--color-dark-2);
      min-width: 90px;
    }

    select {
      flex: 1;
    }
  }

  // Styled selects
  .styled-select {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 0.85em;
    color: var(--color-dark-1);
    cursor: pointer;
    transition: all 0.2s ease;

    &:hover {
      border-color: #d4af37;
      box-shadow: 0 0 4px rgba(212, 175, 55, 0.3);
    }

    &:focus {
      outline: none;
      border-color: #d4af37;
      box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
    }

    &.advantage-select,
    &.modifier-select {
      text-align: center;
      font-weight: 500;
    }
  }

  // Checkbox group
  .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-bottom: 6px;

    .checkbox-label {
      display: flex;
      align-items: center;
      cursor: pointer;
      padding: 3px 4px;
      border-radius: 3px;
      transition: background 0.2s ease;

      &:hover {
        background: rgba(0, 0, 0, 0.05);
      }

      input[type="checkbox"] {
        margin-right: 6px;
        cursor: pointer;
        width: 14px;
        height: 14px;
        accent-color: #d4af37;
      }

      .checkbox-text {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 0.8em;
        color: var(--color-dark-2);

        i {
          color: #888;
          font-size: 0.85em;
        }
      }

      input[type="checkbox"]:checked ~ .checkbox-text {
        color: var(--color-dark-1);
        font-weight: 500;

        i {
          color: #d4af37;
        }
      }
    }
  }
}

// Dialog application styling — only apply grey gradient when roll dialog content is present
.application.dialog.prismrpg:has(.prismrpg-roll-dialog-modern) {
  .window-content {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    padding: 8px;
  }

  // Make buttons match the modern style
  .dialog-buttons {
    padding: 6px 8px;
    gap: 6px;

    button {
      background: linear-gradient(135deg, #4a4a4a 0%, #6a6a6a 100%);
      border: 1px solid #3a3a3a;
      color: white;
      font-weight: 600;
      padding: 6px 12px;
      border-radius: 4px;
      transition: all 0.2s ease;

      &:hover {
        background: linear-gradient(135deg, #5a5a5a 0%, #7a7a7a 100%);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        transform: translateY(-1px);
      }

      &.default,
      &[data-button="roll"] {
        background: linear-gradient(135deg, #d4af37 0%, #f4cf67 100%);
        border-color: #b49030;
        color: #2a2a2a;

        &:hover {
          background: linear-gradient(135deg, #e4bf47 0%, #ffdf77 100%);
        }
      }
    }
  }
}
